|
@@ -317,10 +317,17 @@ public class AutoscalingCalculateCapacityServiceTests extends AutoscalingTestCas
|
|
public void testValidateDeciderRoles() {
|
|
public void testValidateDeciderRoles() {
|
|
Set<String> roles = randomRoles();
|
|
Set<String> roles = randomRoles();
|
|
AutoscalingCalculateCapacityService service = new AutoscalingCalculateCapacityService(Set.of(new FixedAutoscalingDeciderService() {
|
|
AutoscalingCalculateCapacityService service = new AutoscalingCalculateCapacityService(Set.of(new FixedAutoscalingDeciderService() {
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<DiscoveryNodeRole> roles() {
|
|
public List<DiscoveryNodeRole> roles() {
|
|
return roles.stream().map(DiscoveryNode::getRoleFromRoleName).collect(Collectors.toList());
|
|
return roles.stream().map(DiscoveryNode::getRoleFromRoleName).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean appliesToEmptyRoles() {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
}));
|
|
}));
|
|
SortedSet<String> badRoles = new TreeSet<>(randomRoles());
|
|
SortedSet<String> badRoles = new TreeSet<>(randomRoles());
|
|
badRoles.removeAll(roles);
|
|
badRoles.removeAll(roles);
|