Skip to content

Commit 4dafcdf

Browse files
committed
test fix, additional tests
1 parent fb316e0 commit 4dafcdf

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

spring-boot-starter/src/test/java/com/github/containersolutions/operator/spingboot/starter/AutoconfigurationTest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
@SpringBootTest
1919
public class AutoconfigurationTest {
2020

21+
22+
@Autowired
23+
private RetryProperties retryProperties;
24+
2125
@Autowired
2226
private OperatorProperties operatorProperties;
2327

@@ -31,12 +35,21 @@ public class AutoconfigurationTest {
3135
private List<ResourceController> resourceControllers;
3236

3337
@Test
34-
public void configurationsLoadedProperly() {
38+
public void loadsKubernetesClientPropertiesProperly() {
3539
assertEquals("user", operatorProperties.getUsername());
3640
assertEquals("password", operatorProperties.getPassword());
3741
assertEquals("http://master.url", operatorProperties.getMasterUrl());
3842
}
3943

44+
@Test
45+
public void loadsRetryPropertiesProperly() {
46+
assertEquals(3, retryProperties.getMaxAttempts().intValue());
47+
assertEquals(1000, retryProperties.getInitialInterval().intValue());
48+
assertEquals(1.5, retryProperties.getIntervalMultiplier().doubleValue());
49+
assertEquals(50000, retryProperties.getMaxInterval().intValue());
50+
assertEquals(100000, retryProperties.getMaxElapsedTime().intValue());
51+
}
52+
4053
@Test
4154
public void beansCreated() {
4255
assertNotNull(kubernetesClient);

spring-boot-starter/src/test/java/com/github/containersolutions/operator/spingboot/starter/TestController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
import java.util.Optional;
1010

1111
@Component
12-
@Controller(
13-
crdName = "name",
12+
@Controller(crdName = "name",
1413
customResourceClass = TestResource.class)
1514
public class TestController implements ResourceController {
1615

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
operator.kubernetes:
2-
username: user
3-
password: password
4-
masterUrl: http://master.url
1+
operator:
2+
kubernetes.client:
3+
username: user
4+
password: password
5+
masterUrl: http://master.url
6+
7+
controller.retry:
8+
maxAttempts: 3
9+
initialInterval: 1000
10+
intervalMultiplier: 1.5
11+
maxInterval: 50000
12+
maxElapsedTime: 100000

0 commit comments

Comments
 (0)