@Test public void generateSearchFilters () { Map<String, List<String>> filterConfig = new HashMap<>(); filterConfig.put("tag.Filter1", Collections.singletonList("Value1")); filterConfig.put("tag.Filter2", asList("Value2a", "Value2b")); filterConfig.put("keyName", Collections.singletonList("keyValue1")); filterConfig.put("KeyName", Collections.singletonList("keyValue2")); Filter filter1 = new Filter("tag:Filter1", Collections.singletonList("Value1")); Filter filter2 = new Filter("tag:Filter2", asList("Value2a", "Value2b")); Filter filter3 = new Filter("key-name", Collections.singletonList("keyValue1")); Filter filter4 = new Filter("key-name", Collections.singletonList("keyValue2")); awsEC2Platform.setFilter(filterConfig); Collection<Filter> filters = awsEC2Platform.generateSearchFilters(); assertThat(filters, containsInAnyOrder(filter1, filter2, filter3, filter4)); }
Collection<Filter> generateSearchFilters () { return filter.entrySet().stream().map(this::createFilterFromEntry).collect(Collectors.toSet()); }
AwsEC2Platform extends Platform implements SshBasedExperiment<AwsEC2Container> { Collection<Filter> generateSearchFilters () { return filter.entrySet().stream().map(this::createFilterFromEntry).collect(Collectors.toSet()); } }
AwsEC2Platform extends Platform implements SshBasedExperiment<AwsEC2Container> { Collection<Filter> generateSearchFilters () { return filter.entrySet().stream().map(this::createFilterFromEntry).collect(Collectors.toSet()); } @Autowired  AwsEC2Platform(AmazonEC2 amazonEC2, ContainerManager containerManager, AwsEC2SelfAwareness awsEC2SelfAwareness); private  AwsEC2Platform(); }
AwsEC2Platform extends Platform implements SshBasedExperiment<AwsEC2Container> { Collection<Filter> generateSearchFilters () { return filter.entrySet().stream().map(this::createFilterFromEntry).collect(Collectors.toSet()); } @Autowired  AwsEC2Platform(AmazonEC2 amazonEC2, ContainerManager containerManager, AwsEC2SelfAwareness awsEC2SelfAwareness); private  AwsEC2Platform(); void setFilter(@NotNull Map<String, List<String>> filter); void setGroupingTags(List<String> groupingTags); void setSSHPrivateKeys(@NotNull Map<String, String> sshPrivateKeys); Map<String, String> getImageIdToUsernameMap(); void setImageIdToUsernameMap(Map<String, String> imageIdToUsernameMap); @Override ApiStatus getApiStatus(); @JsonIgnore Collection<SubnetUtils.SubnetInfo> getRoutableCidrBlocks(); void setRoutableCidrBlocks(Collection<String> routableCidrBlocks); boolean isAddressRoutable(String privateIPAddress); @Override PlatformLevel getPlatformLevel(); @Override PlatformHealth getPlatformHealth(); @Override List<Container> generateRoster(); @Override boolean isContainerRecycled(Container container); ContainerHealth checkHealth(String instanceId); void stopInstance(String... instanceIds); void terminateInstance(String... instanceIds); void startInstance(String... instanceIds); void restartInstance(String... instanceIds); void setSecurityGroupIds(String networkInterfaceId, Collection<String> securityGroupIds); String getChaosSecurityGroupForInstance(String instanceId); boolean isContainerTerminated(String instanceId); boolean isAutoscalingGroupAtDesiredInstances(String autoScalingGroupName); boolean hasKey(String keyName); @Override void recycleContainer(AwsEC2Container container); void triggerAutoscalingUnhealthy(String instanceId); @Override String getEndpoint(AwsEC2Container container); @Override SSHCredentials getSshCredentials(AwsEC2Container container); boolean isStarted(AwsEC2Container awsEC2Container); Map<String, Set<String>> getNetworkInterfaceToSecurityGroupsMap(String instanceId); boolean verifySecurityGroupIdsOfNetworkInterfaceMap(String instanceId, Map<String, Set<String>> originalSecurityGroups); }
AwsEC2Platform extends Platform implements SshBasedExperiment<AwsEC2Container> { Collection<Filter> generateSearchFilters () { return filter.entrySet().stream().map(this::createFilterFromEntry).collect(Collectors.toSet()); } @Autowired  AwsEC2Platform(AmazonEC2 amazonEC2, ContainerManager containerManager, AwsEC2SelfAwareness awsEC2SelfAwareness); private  AwsEC2Platform(); void setFilter(@NotNull Map<String, List<String>> filter); void setGroupingTags(List<String> groupingTags); void setSSHPrivateKeys(@NotNull Map<String, String> sshPrivateKeys); Map<String, String> getImageIdToUsernameMap(); void setImageIdToUsernameMap(Map<String, String> imageIdToUsernameMap); @Override ApiStatus getApiStatus(); @JsonIgnore Collection<SubnetUtils.SubnetInfo> getRoutableCidrBlocks(); void setRoutableCidrBlocks(Collection<String> routableCidrBlocks); boolean isAddressRoutable(String privateIPAddress); @Override PlatformLevel getPlatformLevel(); @Override PlatformHealth getPlatformHealth(); @Override List<Container> generateRoster(); @Override boolean isContainerRecycled(Container container); ContainerHealth checkHealth(String instanceId); void stopInstance(String... instanceIds); void terminateInstance(String... instanceIds); void startInstance(String... instanceIds); void restartInstance(String... instanceIds); void setSecurityGroupIds(String networkInterfaceId, Collection<String> securityGroupIds); String getChaosSecurityGroupForInstance(String instanceId); boolean isContainerTerminated(String instanceId); boolean isAutoscalingGroupAtDesiredInstances(String autoScalingGroupName); boolean hasKey(String keyName); @Override void recycleContainer(AwsEC2Container container); void triggerAutoscalingUnhealthy(String instanceId); @Override String getEndpoint(AwsEC2Container container); @Override SSHCredentials getSshCredentials(AwsEC2Container container); boolean isStarted(AwsEC2Container awsEC2Container); Map<String, Set<String>> getNetworkInterfaceToSecurityGroupsMap(String instanceId); boolean verifySecurityGroupIdsOfNetworkInterfaceMap(String instanceId, Map<String, Set<String>> originalSecurityGroups);  }