Signed-off-by: wind57 <eugen.rabii@gmail.com>
This commit is contained in:
wind57
2025-03-28 17:02:24 +02:00
parent 8ce9256e37
commit e0a5629cb2
5 changed files with 8 additions and 13 deletions

View File

@@ -44,8 +44,6 @@ import static org.springframework.cloud.kubernetes.configuration.watcher.TestUti
*/
class ActuatorRefreshIT {
private static final String WIREMOCK_PATH = "/";
private static final String NAMESPACE = "default";
private static final K3sContainer K3S = Commons.container();
@@ -72,12 +70,12 @@ class ActuatorRefreshIT {
@BeforeEach
void setup() {
util.wiremock(NAMESPACE, WIREMOCK_PATH, Phase.CREATE);
util.wiremock(NAMESPACE, Phase.CREATE);
}
@AfterEach
void after() {
util.wiremock(NAMESPACE, WIREMOCK_PATH, Phase.DELETE);
util.wiremock(NAMESPACE, Phase.DELETE);
}
/*

View File

@@ -60,7 +60,7 @@ class ActuatorRefreshMultipleNamespacesIT {
util = new Util(K3S);
util.createNamespace(LEFT_NAMESPACE);
util.createNamespace(RIGHT_NAMESPACE);
util.wiremock(DEFAULT_NAMESPACE, "/", Phase.CREATE);
util.wiremock(DEFAULT_NAMESPACE, Phase.CREATE);
util.setUpClusterWide(DEFAULT_NAMESPACE, Set.of(DEFAULT_NAMESPACE, LEFT_NAMESPACE, RIGHT_NAMESPACE));
configWatcher(Phase.CREATE);
}
@@ -68,7 +68,7 @@ class ActuatorRefreshMultipleNamespacesIT {
@AfterAll
static void afterAll() {
configWatcher(Phase.DELETE);
util.wiremock(DEFAULT_NAMESPACE, "/", Phase.DELETE);
util.wiremock(DEFAULT_NAMESPACE, Phase.DELETE);
util.deleteClusterWide(DEFAULT_NAMESPACE, Set.of(DEFAULT_NAMESPACE, LEFT_NAMESPACE, RIGHT_NAMESPACE));
util.deleteNamespace(LEFT_NAMESPACE);
util.deleteNamespace(RIGHT_NAMESPACE);

View File

@@ -46,7 +46,7 @@ final class TestUtil {
private static final String WIREMOCK_HOST = "localhost";
private static final int WIREMOCK_PORT = 80;
private static final int WIREMOCK_PORT = 32321;
static final String SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME = "spring-cloud-kubernetes-configuration-watcher";
@@ -60,7 +60,7 @@ final class TestUtil {
// is ready to take a request via 'Wiremock::stubFor' (because sometimes it fails)
// As such, get the existing mappings and retrySpec() makes sure we retry until
// we get a response back.
WebClient client = builder().baseUrl("http://localhost:80/__admin/mappings").build();
WebClient client = builder().baseUrl("http://localhost:32321/__admin/mappings").build();
client.method(HttpMethod.GET).retrieve().bodyToMono(String.class).retryWhen(retrySpec()).block();
StubMapping stubMapping = WireMock.stubFor(WireMock.post(WireMock.urlEqualTo("/actuator/refresh"))

View File

@@ -409,10 +409,6 @@ public final class Util {
.noneMatch(x -> x.getMetadata().getName().equals(name)));
}
public void wiremock(String namespace, String path, Phase phase) {
wiremock(namespace, phase);
}
public void wiremock(String namespace, Phase phase) {
V1Deployment deployment = (V1Deployment) yaml("wiremock/wiremock-deployment.yaml");

View File

@@ -9,6 +9,7 @@ spec:
- name: http
port: 8080
targetPort: 8080
nodePort: 32321
selector:
app: service-wiremock
type: ClusterIP
type: NodePort