2424
2525package lib .form ;
2626
27- import static org .junit .Assert .assertEquals ;
28- import static org .junit .Assert .fail ;
27+ import static org .junit .jupiter . api . Assertions .assertEquals ;
28+ import static org .junit .jupiter . api . Assertions .fail ;
2929
3030import edu .umd .cs .findbugs .annotations .NonNull ;
3131import hudson .Extension ;
4242import org .htmlunit .html .HtmlElement ;
4343import org .htmlunit .html .HtmlElementUtil ;
4444import org .htmlunit .html .HtmlPage ;
45- import org .junit .Rule ;
46- import org .junit .Test ;
45+ import org .junit .jupiter . api . BeforeEach ;
46+ import org .junit .jupiter . api . Test ;
4747import org .jvnet .hudson .test .Issue ;
4848import org .jvnet .hudson .test .JenkinsRule ;
4949import org .jvnet .hudson .test .TestExtension ;
50+ import org .jvnet .hudson .test .junit .jupiter .WithJenkins ;
5051import org .kohsuke .stapler .DataBoundConstructor ;
5152import org .kohsuke .stapler .QueryParameter ;
5253
5354/**
5455 * @author John McNally
5556 */
56- public class ComboBoxTest {
57+ @ WithJenkins
58+ class ComboBoxTest {
5759
58- @ Rule public JenkinsRule j = new JenkinsRule ();
60+ private JenkinsRule j ;
61+
62+ @ BeforeEach
63+ void setUp (JenkinsRule rule ) {
64+ j = rule ;
65+ }
5966
6067 /**
6168 * Used in testCompoundFieldDependentCombobox for Issue("JENKINS-16719")
@@ -64,6 +71,7 @@ public static class CompoundFieldComboBoxBuilder extends Publisher {
6471 private CompoundField compoundField ;
6572 private String foo ;
6673
74+ @ SuppressWarnings ("checkstyle:redundantmodifier" )
6775 @ DataBoundConstructor
6876 public CompoundFieldComboBoxBuilder (CompoundField compoundField , String foo ) {
6977 this .compoundField = compoundField ;
@@ -105,6 +113,7 @@ public static class CompoundField implements Describable<CompoundField> {
105113 private final String abc ;
106114 private final String xyz ;
107115
116+ @ SuppressWarnings ("checkstyle:redundantmodifier" )
108117 @ DataBoundConstructor
109118 public CompoundField (String abc , String xyz ) {
110119 this .abc = abc ;
@@ -128,7 +137,7 @@ public static final class DescriptorImpl extends Descriptor<CompoundField> {}
128137 */
129138 @ Issue ("JENKINS-16719" )
130139 @ Test
131- public void testCompoundFieldDependentComboBox () throws Exception {
140+ void testCompoundFieldDependentComboBox () throws Exception {
132141 Descriptor d1 = new CompoundFieldComboBoxBuilder .DescriptorImpl ();
133142 Publisher .all ().add (d1 );
134143 Descriptor d2 = new CompoundField .DescriptorImpl ();
@@ -168,7 +177,7 @@ public ComboBoxModel doFillXssItems() {
168177
169178 @ Issue ("SECURITY-1525" )
170179 @ Test
171- public void testEnsureXssNotPossible () throws Exception {
180+ void testEnsureXssNotPossible () throws Exception {
172181 XssProperty xssProperty = new XssProperty ();
173182 FreeStyleProject p = j .createFreeStyleProject ();
174183 p .addProperty (xssProperty );
0 commit comments