de.codecentric.spring.boot.chaos.monkey.conditions.AttackControllerCondition Maven / Gradle / Ivy
package de.codecentric.spring.boot.chaos.monkey.conditions;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
* Condition to attack all public methods in classes annotated with @{@link org.springframework.stereotype.Controller}
*
* @author Benjamin Wilms
*/
public class AttackControllerCondition implements Condition {
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
return
context.getEnvironment()
.getProperty("chaos.monkey.watcher.controller","false")
.matches("(?i:.*true*)");
}
}