diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java index 105a130e0a1..8af105f05dd 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java @@ -33,7 +33,6 @@ import io.fabric8.kubernetes.client.utils.Serialization; import io.fabric8.kubernetes.client.utils.URLUtils; import io.fabric8.kubernetes.client.utils.Utils; -import okhttp3.OkHttpClient; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -56,10 +55,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -275,8 +274,7 @@ void testNoHttpRetryWithDefaultConfig() throws MalformedURLException, IOExceptio }); // Then - assertTrue("As the first failure is an IOException the message of the causedBy expected to contain the given text: 'For example java.net.ConnectException'!", - exception.getCause().getMessage().contains("For example java.net.ConnectException")); + assertTrue(exception.getCause().getMessage().contains("For example java.net.ConnectException"), "As the first failure is an IOException the message of the causedBy expected to contain the given text: 'For example java.net.ConnectException'!"); assertEquals(1, httpExecutionCounter.get()); } @@ -297,9 +295,8 @@ void testHttpRetryWithMoreFailuresThanRetries() throws MalformedURLException, IO }); // Then - assertTrue("As the last failure, the 3rd one, is not an IOException the message expected to contain: 'Internal Server Error'!", - exception.getMessage().contains("Internal Server Error")); - assertEquals("Expected 4 calls: one normal try and 3 backoff retries!", 4, httpExecutionCounter.get()); + assertTrue(exception.getMessage().contains("Internal Server Error"), "As the last failure, the 3rd one, is not an IOException the message expected to contain: 'Internal Server Error'!"); + assertEquals(4, httpExecutionCounter.get(), "Expected 4 calls: one normal try and 3 backoff retries!"); } @Test @@ -318,7 +315,7 @@ void testHttpRetryWithLessFailuresThanRetries() throws MalformedURLException, IO // Then assertNotNull(result); - assertEquals("Expected 3 calls: 2 failures and 1 success!", 3, httpExecutionCounter.get()); + assertEquals(3, httpExecutionCounter.get(), "Expected 3 calls: 2 failures and 1 success!"); } @Test diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/informers/cache/ReflectorTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/informers/cache/ReflectorTest.java index d8efa074505..86ccdfd2730 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/informers/cache/ReflectorTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/informers/cache/ReflectorTest.java @@ -26,9 +26,9 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; class ReflectorTest {