JcloudsLocationSecurityGroupCustomizer extends BasicJcloudsLocationCustomizer { public JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location, IpPermission... permissions) { addPermissionsToLocation(location, ImmutableList.copyOf(permissions)); return this; } protected  JcloudsLocationSecurityGroupCustomizer(String applicationId); protected  JcloudsLocationSecurityGroupCustomizer(String applicationId, Supplier<Cidr> sshCidrSupplier); static JcloudsLocationSecurityGroupCustomizer getInstance(String applicationId); static JcloudsLocationSecurityGroupCustomizer getInstance(Entity entity); JcloudsLocationSecurityGroupCustomizer setRetryExceptionPredicate(Predicate<Exception> predicate); JcloudsLocationSecurityGroupCustomizer setSshCidrSupplier(Supplier<Cidr> cidrSupplier); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location,
            IpPermission... permissions); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location,
             SecurityGroupDefinition securityGroupDefinition); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location,
              final Iterable<IpPermission> permissions); Collection<SecurityGroup> addPermissionsToLocationAndReturnSecurityGroup(
        final JcloudsMachineLocation location, final Iterable<IpPermission> permissions); void removePermissionsFromLocation(JcloudsMachineLocation location, Iterable<IpPermission> permissions); @Override void customize(JcloudsLocation location, ComputeService computeService, Template template); String getBrooklynCidrBlock(); static Predicate<Exception> newAwsExceptionRetryPredicate();  }
@Test public void testAddPermissionWhenNoExtension() { IpPermission ssh = newPermission(22); IpPermission jmx = newPermission(31001); when(securityApi.listSecurityGroupsForNode(NODE_ID)).thenReturn(Collections.<SecurityGroup>emptySet()); RuntimeException exception = null; try { customizer.addPermissionsToLocation(jcloudsMachineLocation, ImmutableList.of(ssh, jmx)); } catch(RuntimeException e){ exception = e; } assertNotNull(exception); }