Skip to content

Commit 20e70e5

Browse files
committed
Add unit test with @EnableMockServer
1 parent fd3299a commit 20e70e5

File tree

3 files changed

+94
-72
lines changed

3 files changed

+94
-72
lines changed
Lines changed: 78 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,87 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
56

6-
<parent>
7-
<groupId>io.javaoperatorsdk</groupId>
8-
<artifactId>java-operator-sdk-samples</artifactId>
9-
<version>1.5.1-SNAPSHOT</version>
10-
</parent>
7+
<parent>
8+
<groupId>io.javaoperatorsdk</groupId>
9+
<artifactId>java-operator-sdk-samples</artifactId>
10+
<version>1.5.1-SNAPSHOT</version>
11+
</parent>
1112

12-
<artifactId>operator-framework-samples-spring-boot-auto-configuration</artifactId>
13-
<name>Operator SDK - Samples - Spring Boot - Auto Config</name>
14-
<description>Sample usage with Spring Boot</description>
15-
<packaging>jar</packaging>
13+
<artifactId>operator-framework-samples-spring-boot-auto-configuration</artifactId>
14+
<name>Operator SDK - Samples - Spring Boot - Auto Config</name>
15+
<description>Sample usage with Spring Boot</description>
16+
<packaging>jar</packaging>
1617

17-
<properties>
18-
<java.version>11</java.version>
19-
<maven.compiler.source>11</maven.compiler.source>
20-
<maven.compiler.target>11</maven.compiler.target>
21-
</properties>
18+
<properties>
19+
<java.version>11</java.version>
20+
<maven.compiler.source>11</maven.compiler.source>
21+
<maven.compiler.target>11</maven.compiler.target>
22+
</properties>
2223

24+
<dependencies>
25+
<dependency>
26+
<groupId>io.javaoperatorsdk</groupId>
27+
<artifactId>operator-framework-samples-common</artifactId>
28+
<version>${project.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>io.javaoperatorsdk</groupId>
32+
<artifactId>operator-framework-spring-boot-starter</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-test</artifactId>
38+
<scope>test</scope>
39+
<exclusions>
40+
<exclusion>
41+
<groupId>org.junit.vintage</groupId>
42+
<artifactId>junit-vintage-engine</artifactId>
43+
</exclusion>
44+
<exclusion>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-logging</artifactId>
47+
</exclusion>
48+
<exclusion>
49+
<groupId>org.skyscreamer</groupId>
50+
<artifactId>jsonassert</artifactId>
51+
</exclusion>
52+
</exclusions>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.springframework.boot</groupId>
56+
<artifactId>spring-boot-starter-log4j2</artifactId>
57+
</dependency>
58+
59+
<dependency>
60+
<groupId>io.javaoperatorsdk</groupId>
61+
<artifactId>operator-framework-spring-boot-starter-test</artifactId>
62+
<version>${project.version}</version>
63+
</dependency>
64+
</dependencies>
65+
66+
<dependencyManagement>
2367
<dependencies>
24-
<dependency>
25-
<groupId>io.javaoperatorsdk</groupId>
26-
<artifactId>operator-framework-samples-common</artifactId>
27-
<version>${project.version}</version>
28-
</dependency>
29-
<dependency>
30-
<groupId>io.javaoperatorsdk</groupId>
31-
<artifactId>operator-framework-spring-boot-starter</artifactId>
32-
<version>${project.version}</version>
33-
</dependency>
34-
<dependency>
35-
<groupId>org.springframework.boot</groupId>
36-
<artifactId>spring-boot-starter-test</artifactId>
37-
<scope>test</scope>
38-
<exclusions>
39-
<exclusion>
40-
<groupId>org.junit.vintage</groupId>
41-
<artifactId>junit-vintage-engine</artifactId>
42-
</exclusion>
43-
<exclusion>
44-
<groupId>org.springframework.boot</groupId>
45-
<artifactId>spring-boot-starter-logging</artifactId>
46-
</exclusion>
47-
<exclusion>
48-
<groupId>org.skyscreamer</groupId>
49-
<artifactId>jsonassert</artifactId>
50-
</exclusion>
51-
</exclusions>
52-
</dependency>
53-
<dependency>
54-
<groupId>org.springframework.boot</groupId>
55-
<artifactId>spring-boot-starter-log4j2</artifactId>
56-
</dependency>
68+
<dependency>
69+
<groupId>org.springframework.boot</groupId>
70+
<artifactId>spring-boot-dependencies</artifactId>
71+
<version>2.3.4.RELEASE</version>
72+
<type>pom</type>
73+
<scope>import</scope>
74+
</dependency>
5775
</dependencies>
76+
</dependencyManagement>
5877

59-
<dependencyManagement>
60-
<dependencies>
61-
<dependency>
62-
<groupId>org.springframework.boot</groupId>
63-
<artifactId>spring-boot-dependencies</artifactId>
64-
<version>2.3.4.RELEASE</version>
65-
<type>pom</type>
66-
<scope>import</scope>
67-
</dependency>
68-
</dependencies>
69-
</dependencyManagement>
70-
71-
<build>
72-
<plugins>
73-
<plugin>
74-
<groupId>org.springframework.boot</groupId>
75-
<artifactId>spring-boot-maven-plugin</artifactId>
76-
<version>2.3.4.RELEASE</version>
77-
</plugin>
78-
</plugins>
79-
</build>
78+
<build>
79+
<plugins>
80+
<plugin>
81+
<groupId>org.springframework.boot</groupId>
82+
<artifactId>spring-boot-maven-plugin</artifactId>
83+
<version>2.3.4.RELEASE</version>
84+
</plugin>
85+
</plugins>
86+
</build>
8087
</project>

samples/spring-boot-auto-config/src/test/java/io/javaoperatorsdk/operator/sample/SpringBootStarterSampleApplicationIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
public class SpringBootStarterSampleApplicationIT {
88

99
@Test
10-
void contextLoads() {}
10+
void contextLoads() {
11+
}
1112
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.javaoperatorsdk.operator.sample;
2+
3+
import io.javaoperatorsdk.operator.springboot.starter.test.EnableMockOperator;
4+
import org.junit.jupiter.api.Test;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
7+
@SpringBootTest
8+
@EnableMockOperator
9+
public class SpringBootStarterSampleApplicationTest {
10+
11+
@Test
12+
void contextLoads() {
13+
}
14+
}

0 commit comments

Comments
 (0)