|
23 | 23 | */ |
24 | 24 | package jp.ikedam.jenkins.plugins.extensible_choice_parameter; |
25 | 25 |
|
26 | | -import static org.junit.Assert.*; |
| 26 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
27 | 27 |
|
28 | | -import org.junit.Test; |
| 28 | +import org.junit.jupiter.api.Test; |
29 | 29 |
|
30 | 30 | /** |
31 | 31 | * Test for ExtensibleChoiceParameterDefinition, not corresponding to Jenkins. |
32 | 32 | */ |
33 | | -public class ExtensibleChoiceParameterDefinitionSimpleTest { |
| 33 | +class ExtensibleChoiceParameterDefinitionSimpleTest { |
| 34 | + |
34 | 35 | @Test |
35 | | - public void testExtensibleChoiceParameterDefinition_name() { |
| 36 | + void testExtensibleChoiceParameterDefinition_name() { |
36 | 37 | // Simple value |
37 | 38 | { |
38 | 39 | ExtensibleChoiceParameterDefinition target = |
39 | 40 | new ExtensibleChoiceParameterDefinition("name", null, false, "Some text"); |
40 | | - assertEquals("Simple value", "name", target.getName()); |
| 41 | + assertEquals("name", target.getName(), "Simple value"); |
41 | 42 | } |
42 | 43 | // value surrounded with spaces. |
43 | 44 | { |
44 | 45 | ExtensibleChoiceParameterDefinition target = |
45 | 46 | new ExtensibleChoiceParameterDefinition(" name ", null, false, "Some text"); |
46 | | - assertEquals("value surrounded with spaces.", "name", target.getName()); |
| 47 | + assertEquals("name", target.getName(), "value surrounded with spaces."); |
47 | 48 | } |
48 | 49 | } |
49 | 50 |
|
50 | 51 | @Test |
51 | | - public void testExtensibleChoiceParameterDefinition_nameWithInvalidValue() { |
| 52 | + void testExtensibleChoiceParameterDefinition_nameWithInvalidValue() { |
52 | 53 | // empty |
53 | 54 | { |
54 | 55 | ExtensibleChoiceParameterDefinition target = |
55 | 56 | new ExtensibleChoiceParameterDefinition("", null, false, "Some text"); |
56 | | - assertEquals("Empty", "", target.getName()); |
| 57 | + assertEquals("", target.getName(), "Empty"); |
57 | 58 | } |
58 | 59 | // blank. |
59 | 60 | { |
60 | 61 | ExtensibleChoiceParameterDefinition target = |
61 | 62 | new ExtensibleChoiceParameterDefinition(" ", null, false, "Some text"); |
62 | | - assertEquals("blank", "", target.getName()); |
| 63 | + assertEquals("", target.getName(), "blank"); |
63 | 64 | } |
64 | 65 | } |
65 | 66 |
|
66 | 67 | @Test |
67 | | - public void testExtensibleChoiceParameterDefinition_description() { |
| 68 | + void testExtensibleChoiceParameterDefinition_description() { |
68 | 69 | // Simple value |
69 | 70 | { |
70 | 71 | String description = "Some text"; |
71 | 72 | ExtensibleChoiceParameterDefinition target = |
72 | 73 | new ExtensibleChoiceParameterDefinition("name", null, false, description); |
73 | | - assertEquals("Simple value", description, target.getDescription()); |
| 74 | + assertEquals(description, target.getDescription(), "Simple value"); |
74 | 75 | } |
75 | 76 |
|
76 | 77 | // value surrounded with blank letters |
77 | 78 | { |
78 | 79 | String description = " \nSome\n text "; |
79 | 80 | ExtensibleChoiceParameterDefinition target = |
80 | 81 | new ExtensibleChoiceParameterDefinition("name", null, false, description); |
81 | | - assertEquals("value surrounded with blank letters", description, target.getDescription()); |
| 82 | + assertEquals(description, target.getDescription(), "value surrounded with blank letters"); |
82 | 83 | } |
83 | 84 |
|
84 | 85 | // null |
85 | 86 | { |
86 | 87 | String description = null; |
87 | 88 | ExtensibleChoiceParameterDefinition target = |
88 | 89 | new ExtensibleChoiceParameterDefinition("name", null, false, description); |
89 | | - assertEquals("null", description, target.getDescription()); |
| 90 | + assertEquals(description, target.getDescription(), "null"); |
90 | 91 | } |
91 | 92 | } |
92 | 93 |
|
93 | 94 | @Test |
94 | | - public void testExtensibleChoiceParameterDefinition_choiceListProvider() { |
| 95 | + void testExtensibleChoiceParameterDefinition_choiceListProvider() { |
95 | 96 | // Simple value |
96 | 97 | { |
97 | 98 | ChoiceListProvider provider = new TextareaChoiceListProvider("a\nb\nc\n", null, false, null); |
98 | 99 | ExtensibleChoiceParameterDefinition target = |
99 | 100 | new ExtensibleChoiceParameterDefinition("name", provider, false, "Some Text"); |
100 | | - assertEquals("Simple value", provider, target.getChoiceListProvider()); |
| 101 | + assertEquals(provider, target.getChoiceListProvider(), "Simple value"); |
101 | 102 | } |
102 | 103 |
|
103 | 104 | // null |
104 | 105 | { |
105 | 106 | ChoiceListProvider provider = null; |
106 | 107 | ExtensibleChoiceParameterDefinition target = |
107 | 108 | new ExtensibleChoiceParameterDefinition("name", provider, false, "Some Text"); |
108 | | - assertEquals("null", provider, target.getChoiceListProvider()); |
| 109 | + assertEquals(provider, target.getChoiceListProvider(), "null"); |
109 | 110 | } |
110 | 111 | } |
111 | 112 |
|
112 | 113 | @Test |
113 | | - public void testExtensibleChoiceParameterDefinition_editable() { |
| 114 | + void testExtensibleChoiceParameterDefinition_editable() { |
114 | 115 | // editable |
115 | 116 | { |
116 | 117 | boolean editable = true; |
117 | 118 | ExtensibleChoiceParameterDefinition target = |
118 | 119 | new ExtensibleChoiceParameterDefinition("name", null, editable, "Some Text"); |
119 | | - assertEquals("editable", editable, target.isEditable()); |
| 120 | + assertEquals(editable, target.isEditable(), "editable"); |
120 | 121 | } |
121 | 122 |
|
122 | 123 | // noneditable |
123 | 124 | { |
124 | 125 | boolean editable = false; |
125 | 126 | ExtensibleChoiceParameterDefinition target = |
126 | 127 | new ExtensibleChoiceParameterDefinition("name", null, editable, "Some Text"); |
127 | | - assertEquals("noneditable", editable, target.isEditable()); |
| 128 | + assertEquals(editable, target.isEditable(), "noneditable"); |
128 | 129 | } |
129 | 130 | } |
130 | 131 | } |
0 commit comments