Skip to content

Commit cf72870

Browse files
authored
refactor k8s discovery server integration tests (#1877)
* started Signed-off-by: wind57 <[email protected]> * dirty Signed-off-by: wind57 <[email protected]> * fix Signed-off-by: wind57 <[email protected]> * fix test Signed-off-by: wind57 <[email protected]> * fix test Signed-off-by: wind57 <[email protected]> --------- Signed-off-by: wind57 <[email protected]>
1 parent f1c7e9d commit cf72870

File tree

17 files changed

+389
-643
lines changed

17 files changed

+389
-643
lines changed

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/pom.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
<artifactId>spring-cloud-kubernetes-k8s-client-discovery-server</artifactId>
1313

14+
<properties>
15+
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
16+
<spring-boot.build-image.skip>true</spring-boot.build-image.skip>
17+
</properties>
18+
1419
<dependencies>
1520
<dependency>
1621
<groupId>org.springframework.boot</groupId>
@@ -43,10 +48,6 @@
4348
<directory>../src/main/resources</directory>
4449
<filtering>true</filtering>
4550
</resource>
46-
<resource>
47-
<directory>src/main/resources</directory>
48-
<filtering>true</filtering>
49-
</resource>
5051
</resources>
5152
</build>
5253

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.kubernetes.discoveryclient.it;
18+
19+
import org.springframework.boot.SpringApplication;
20+
import org.springframework.boot.autoconfigure.SpringBootApplication;
21+
import org.springframework.scheduling.annotation.EnableScheduling;
22+
23+
/**
24+
* @author wind57
25+
*/
26+
@SpringBootApplication
27+
@EnableScheduling
28+
public class App {
29+
30+
public static void main(String[] args) {
31+
SpringApplication.run(App.class, args);
32+
}
33+
34+
}

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/src/main/java/org/springframework/cloud/kubernetes/discoveryclient/it/HeartbeatListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class HeartbeatListener implements ApplicationListener<HeartbeatEvent> {
3535

3636
private static final LogAccessor LOG = new LogAccessor(LogFactory.getLog(HeartbeatListener.class));
3737

38-
AtomicReference<List<EndpointNameAndNamespace>> state = new AtomicReference<>(List.of());
38+
public final AtomicReference<List<EndpointNameAndNamespace>> state = new AtomicReference<>(List.of());
3939

4040
@Override
4141
@SuppressWarnings("unchecked")
4242
public void onApplicationEvent(HeartbeatEvent event) {
43-
LOG.info("received heartbeat event");
43+
LOG.info("received heartbeat event in listener");
4444
List<EndpointNameAndNamespace> state = (List<EndpointNameAndNamespace>) event.getValue();
4545
this.state.set(state);
4646
LOG.info("state received : " + state);

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/src/main/java/org/springframework/cloud/kubernetes/discoveryclient/it/KubernetesDiscoveryClientApplicationIt.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/src/main/resources/application.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceDelegate.java

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)