Skip to content

Commit 699a6d4

Browse files
committed
Disable all assaults/watcher in integration-tests of chaos-monkey-demo-app
1 parent a2155ef commit 699a6d4

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

demo-apps/chaos-monkey-demo-app/src/test/java/com/example/chaos/monkey/chaosdemo/controller/HelloControllerIntegrationTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,11 +27,9 @@
2727
import org.springframework.boot.test.web.client.TestRestTemplate;
2828
import org.springframework.http.HttpStatus;
2929
import org.springframework.http.ResponseEntity;
30-
import org.springframework.test.context.TestPropertySource;
3130

3231
/** @author Benjamin Wilms */
33-
@SpringBootTest(classes = ChaosDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
34-
@TestPropertySource("classpath:application-test.properties")
32+
@SpringBootTest(classes = ChaosDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "chaos.monkey.watcher.controller=true")
3533
public class HelloControllerIntegrationTest {
3634

3735
@Autowired

demo-apps/chaos-monkey-demo-app/src/test/java/com/example/chaos/monkey/chaosdemo/repo/RepositoryWatcherIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
2323

24-
@SpringBootTest(properties = {"spring.profiles.active=chaos-monkey", "chaos.monkey.enabled=true", "chaos.monkey.assaults.exceptions-active=true",
25-
"chaos.monkey.watcher.repository=true", "chaos.monkey.assaults.level=1", "chaos.monkey.assaults.latency-active=false"})
24+
@SpringBootTest(properties = {"chaos.monkey.assaults.exceptions-active=true", "chaos.monkey.watcher.repository=true",
25+
"chaos.monkey.assaults.level=1"})
2626
class RepositoryWatcherIntegrationTest {
2727

2828
@Autowired

demo-apps/chaos-monkey-demo-app/src/test/resources/application-test.properties renamed to demo-apps/chaos-monkey-demo-app/src/test/resources/application.properties

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,22 @@
1414
# limitations under the License.
1515
#
1616
spring.profiles.active=chaos-monkey
17-
chaos.monkey.assaults.latency-range-start=10
18-
chaos.monkey.assaults.latency-range-end=50
17+
chaos.monkey.enabled=true
18+
chaos.monkey.assaults.latencyActive=false
19+
chaos.monkey.assaults.latencyRangeStart=1000
20+
chaos.monkey.assaults.latencyRangeEnd=4500
21+
chaos.monkey.assaults.exceptions-active=false
22+
chaos.monkey.watcher.controller=false
23+
chaos.monkey.watcher.component=false
24+
chaos.monkey.watcher.restController=false
25+
chaos.monkey.watcher.service=false
26+
chaos.monkey.watcher.repository=false
27+
chaos.monkey.watcher.beans=helloBean
28+
chaos.monkey.assaults.level=1
29+
management.endpoint.chaosmonkey.enabled=true
30+
management.endpoint.chaosmonkeyjmx.enabled=false
31+
management.endpoints.web.exposure.include=*
32+
1933

2034
# set management port to 0 to use default port
2135
management.server.port=0

0 commit comments

Comments
 (0)