@Test public void testIsScalableShouldReturnFalseWhenThereArePendingInstances() { Set<InstanceMetaData> instanceMetaData = createInstanceMetadataWithPendingInstance(); Stack stack = createStac(instanceMetaData); boolean actual = underTest.isScalable(stack, GROUP_NAME); assertFalse(actual); }
boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); }
StackScalabilityCondition { boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); } }
StackScalabilityCondition { boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); }  }
StackScalabilityCondition { boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); }   }
StackScalabilityCondition { boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); }    }