Signed-off-by: wind57 <eugen.rabii@gmail.com>
This commit is contained in:
wind57
2025-03-27 14:20:07 +02:00
parent dc8862d32a
commit 437ab1310e
4 changed files with 9 additions and 10 deletions

View File

@@ -16,7 +16,7 @@
package org.springframework.cloud.kubernetes.client;
import org.junit.jupiter.api.Assertions;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -57,8 +57,7 @@ class ActuatorDisabledHealthTest {
.jsonPath("components.kubernetes")
.doesNotExist();
Assertions.assertNull(registry.getContributor("kubernetes"),
"reactive kubernetes contributor must NOT be present when 'management.health.kubernetes.enabled=false'");
Assertions.assertThat(registry.getContributor("kubernetes")).isNull();
}
}

View File

@@ -23,8 +23,8 @@ import java.nio.file.Paths;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.util.Config;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
@@ -68,7 +68,7 @@ class ActuatorEnabledFailFastExceptionTest {
@Test
void test() throws ApiException {
Health health = healthIndicator.getHealth(true);
Assertions.assertEquals(health.getStatus(), Status.DOWN);
Assertions.assertThat(Status.DOWN).isSameAs(health.getStatus());
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace", null);
}

View File

@@ -16,7 +16,7 @@
package org.springframework.cloud.kubernetes.client;
import org.junit.jupiter.api.Assertions;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -54,8 +54,8 @@ class ActuatorEnabledHealthTest {
.jsonPath("components.kubernetes")
.exists();
Assertions.assertNotNull(registry.getContributor("kubernetes"),
"reactive kubernetes contributor must be present when 'management.health.kubernetes.enabled=true'");
Assertions.assertThat(registry.getContributor("kubernetes")).isNotNull();
}
}

View File

@@ -23,8 +23,8 @@ import java.nio.file.Paths;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.util.Config;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
@@ -71,7 +71,7 @@ class ActuatorEnabledNoFailFastExceptionTest {
@Test
void test() throws ApiException {
Health health = healthIndicator.getHealth(true);
Assertions.assertEquals(health.getStatus(), Status.UP);
Assertions.assertThat(Status.UP).isSameAs(health.getStatus());
Mockito.verify(coreV1Api).readNamespacedPod("host", "my-namespace", null);
}