@Test public void getPermissions_noneExisting() { securityGroupStartingRules(); replayAll(); assertEquals(ImmutableSet.of(), service().getPermissions("securityGroupName", "dc1")); }
@Override public ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter) { Optional<SecurityGroup> securityGroup = getSecurityGroup(groupName, dataCenter); if (securityGroup.isPresent()) { return fromIpPermissions(securityGroup.get().getIpPermissions()); } return ImmutableSet.of(); }
Ec2SecurityGroupService implements SecurityGroupService { @Override public ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter) { Optional<SecurityGroup> securityGroup = getSecurityGroup(groupName, dataCenter); if (securityGroup.isPresent()) { return fromIpPermissions(securityGroup.get().getIpPermissions()); } return ImmutableSet.of(); } }
Ec2SecurityGroupService implements SecurityGroupService { @Override public ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter) { Optional<SecurityGroup> securityGroup = getSecurityGroup(groupName, dataCenter); if (securityGroup.isPresent()) { return fromIpPermissions(securityGroup.get().getIpPermissions()); } return ImmutableSet.of(); } @Inject  Ec2SecurityGroupService(Provider<AmazonEC2> amazonEC2Provider,
      @Named(SecurityGroupModule.SECURITY_GROUP_DATACENTERS_PROPERTY) Map<String, Region> regions); }
Ec2SecurityGroupService implements SecurityGroupService { @Override public ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter) { Optional<SecurityGroup> securityGroup = getSecurityGroup(groupName, dataCenter); if (securityGroup.isPresent()) { return fromIpPermissions(securityGroup.get().getIpPermissions()); } return ImmutableSet.of(); } @Inject  Ec2SecurityGroupService(Provider<AmazonEC2> amazonEC2Provider,
      @Named(SecurityGroupModule.SECURITY_GROUP_DATACENTERS_PROPERTY) Map<String, Region> regions); @Override boolean exists(String groupName, String dataCenter); @Override void create(String groupName, String dataCenter); @Override ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter); @Override void authorizeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission); @Override void revokeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission); }
Ec2SecurityGroupService implements SecurityGroupService { @Override public ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter) { Optional<SecurityGroup> securityGroup = getSecurityGroup(groupName, dataCenter); if (securityGroup.isPresent()) { return fromIpPermissions(securityGroup.get().getIpPermissions()); } return ImmutableSet.of(); } @Inject  Ec2SecurityGroupService(Provider<AmazonEC2> amazonEC2Provider,
      @Named(SecurityGroupModule.SECURITY_GROUP_DATACENTERS_PROPERTY) Map<String, Region> regions); @Override boolean exists(String groupName, String dataCenter); @Override void create(String groupName, String dataCenter); @Override ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter); @Override void authorizeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission); @Override void revokeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission);  }