5656import static org .junit .Assert .*;
5757import static org .mockito .Matchers .any ;
5858import static org .mockito .Matchers .anyInt ;
59+ import static org .mockito .Matchers .anyString ;
5960import static org .mockito .Matchers .eq ;
6061import static org .mockito .Mockito .atLeastOnce ;
6162import static org .mockito .Mockito .mock ;
@@ -101,7 +102,7 @@ public void abortProvisioningWhenOpenstackFails() throws Exception {
101102 JCloudsSlaveTemplate template = j .dummySlaveTemplate ("label" );
102103 JCloudsCloud cloud = j .dummyCloud (template );
103104 Openstack os = cloud .getOpenstack ();
104- when (os .bootAndWaitActive (any (ServerCreateBuilder .class ), any ( Integer . class ))).thenThrow (new Openstack .ActionFailed ("It is broken, alright!" ));
105+ when (os .bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ( ))).thenThrow (new Openstack .ActionFailed ("It is broken, alright!" ));
105106
106107 FreeStyleProject p = j .createFreeStyleProject ();
107108 p .setAssignedLabel (Label .get ("label" ));
@@ -110,7 +111,7 @@ public void abortProvisioningWhenOpenstackFails() throws Exception {
110111 Thread .sleep (1000 );
111112 assertFalse (started .isDone ());
112113
113- verify (os , atLeastOnce ()).bootAndWaitActive (any (ServerCreateBuilder .class ), any ( Integer . class ));
114+ verify (os , atLeastOnce ()).bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ( ));
114115 }
115116
116117 @ Test @ Issue ("https://github.com/jenkinsci/openstack-cloud-plugin/issues/37" )
@@ -119,8 +120,8 @@ public void detectBootTimingOut() {
119120 final JCloudsCloud cloud = j .dummyCloud (template );
120121 Openstack os = cloud .getOpenstack ();
121122 Server server = j .mockServer ().name ("provisioned" ).status (Server .Status .BUILD ).get ();
122- when (os .bootAndWaitActive (any (ServerCreateBuilder .class ), any ( Integer . class ))).thenCallRealMethod ();
123- when (os ._bootAndWaitActive (any (ServerCreateBuilder .class ), any ( Integer . class ))).thenReturn (server );
123+ when (os .bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ( ))).thenCallRealMethod ();
124+ when (os ._bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ( ))).thenReturn (server );
124125 when (os .updateInfo (eq (server ))).thenReturn (server );
125126
126127 try {
@@ -150,7 +151,7 @@ public void verifyOptionsPropagatedToLauncher() throws Exception {
150151 assertEquals (slave .getPublicAddress (), launcher .getHost ());
151152 assertEquals ("credid" , launcher .getCredentialsId ());
152153 //noinspection deprecation
153- assertEquals ("java" , launcher .getJavaPath ()); // https://github.com/jenkinsci/ssh-slaves-plugin/commit/9d25b12b1340e00d63a069f54c1b2361f745b6fc#commitcomment-49501649
154+ assertEquals ("java" , launcher .getHost ()); // https://github.com/jenkinsci/ssh-slaves-plugin/commit/9d25b12b1340e00d63a069f54c1b2361f745b6fc#commitcomment-49501649
154155 assertEquals (expected .getJvmOptions (), launcher .getJvmOptions ());
155156 assertEquals (10 , (int ) slave .getSlaveOptions ().getRetentionTime ());
156157
@@ -306,7 +307,7 @@ public void timeoutProvisioning() throws Exception {
306307 when (os ._bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ())).thenReturn (null ); // Timeout
307308 when (os .bootAndWaitActive (any (ServerCreateBuilder .class ), anyInt ())).thenCallRealMethod ();
308309 Server server = mock (Server .class );
309- when (os .getServersByName (any ( String . class ))).thenReturn (Collections .singletonList (server ));
310+ when (os .getServersByName (anyString ( ))).thenReturn (Collections .singletonList (server ));
310311
311312 for (NodeProvisioner .PlannedNode pn : c .provision (Label .get ("label" ), 1 )) {
312313 try {
@@ -472,7 +473,6 @@ public void failIfNoAccessIpFound() {
472473 private void verifyPreferredAddressUsed (String expectedAddress , Collection <NetworkAddress > addresses ) throws Exception {
473474 CloudStatistics cs = CloudStatistics .get ();
474475 assertThat (cs .getActivities (), Matchers .iterableWithSize (0 ));
475-
476476 j .autoconnectJnlpSlaves ();
477477 JCloudsCloud cloud = j .configureSlaveProvisioning (j .dummyCloud (j .dummySlaveTemplate ("label" )), addresses );
478478
0 commit comments