Skip to content

Commit

Permalink
Merge pull request #152 from Caps-Looking/master
Browse files Browse the repository at this point in the history
Removing unecessary empty check on watchedCustomService
  • Loading branch information
WtfJoke committed Nov 27, 2019
2 parents b1cacfb + befdbe2 commit 1760c8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions chaos-monkey-docs/src/main/asciidoc/changes.adoc
Expand Up @@ -14,6 +14,7 @@
- https://github.com/codecentric/chaos-monkey-spring-boot/pull/141[#141] Migrate tests to JUnit Jupiter
- https://github.com/codecentric/chaos-monkey-spring-boot/pull/143[#143] Add Maven Wrapper
- https://github.com/codecentric/chaos-monkey-spring-boot/pull/148[#148] Add new aspect for watching non-JPA repositories.
- https://github.com/codecentric/chaos-monkey-spring-boot/pull/152[#152] Remove unnecessary empty-check on watchedCustomService.
- https://github.com/codecentric/chaos-monkey-spring-boot/pull/146[#146] Migrate ChaosMonkeyRequestScopeTest to JUnit Jupiter

=== New Features
Expand All @@ -29,5 +30,6 @@ This release was only possible because of these great humans:
- https://github.com/Yann-P[@Yann-P]
- https://github.com/Riggs333[@Riggs333]
- https://github.com/ericwyles[@EricWyles]
- https://github.com/Caps-Looking[@Caps-Looking]

Thank you for your support!
Expand Up @@ -87,7 +87,7 @@ public void callChaosMonkey(String simpleName) {

// Custom watched services can be defined at runtime, if there are any, only these will be attacked!
if (chaosMonkeySettings.getAssaultProperties().isWatchedCustomServicesActive()) {
if (!chaosMonkeySettings.getAssaultProperties().getWatchedCustomServices().isEmpty() && chaosMonkeySettings.getAssaultProperties().getWatchedCustomServices().contains(simpleName)) {
if (chaosMonkeySettings.getAssaultProperties().getWatchedCustomServices().contains(simpleName)) {
// only all listed custom methods will be attacked
chooseAndRunAttack();
}
Expand Down
Expand Up @@ -22,6 +22,7 @@
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.DecimalMax;
Expand Down Expand Up @@ -117,7 +118,7 @@ public int chooseAssault(int amount) {

@JsonIgnore
public boolean isWatchedCustomServicesActive() {
return watchedCustomServices != null && !watchedCustomServices.isEmpty();
return !CollectionUtils.isEmpty(watchedCustomServices);
}


Expand Down

0 comments on commit 1760c8b

Please sign in to comment.