@Test public void testConvertWithNullSecurityRulesAndNullGroupIds() { SecurityGroupRequest securityGroupRequest = new SecurityGroupRequest(); securityGroupRequest.setSecurityRules(null); securityGroupRequest.setSecurityGroupIds(null); SecurityGroup result = underTest.convert(securityGroupRequest); assertNotNull(result.getSecurityGroupIds()); assertTrue(result.getSecurityGroupIds().isEmpty()); assertNotNull(result.getSecurityRules()); assertTrue(result.getSecurityRules().isEmpty()); }
@Override public SecurityGroup convert(@Nonnull SecurityGroupRequest source) { SecurityGroup entity = new SecurityGroup(); entity.setName(missingResourceNameGenerator.generateName(APIResourceType.SECURITY_GROUP)); entity.setSecurityGroupIds(convertSecurityGroupIdsToList(source)); entity.setSecurityRules(convertSecurityRules(source.getSecurityRules(), entity)); return entity; }
SecurityGroupRequestToSecurityGroupConverter implements Converter<SecurityGroupRequest, SecurityGroup> { @Override public SecurityGroup convert(@Nonnull SecurityGroupRequest source) { SecurityGroup entity = new SecurityGroup(); entity.setName(missingResourceNameGenerator.generateName(APIResourceType.SECURITY_GROUP)); entity.setSecurityGroupIds(convertSecurityGroupIdsToList(source)); entity.setSecurityRules(convertSecurityRules(source.getSecurityRules(), entity)); return entity; } }
SecurityGroupRequestToSecurityGroupConverter implements Converter<SecurityGroupRequest, SecurityGroup> { @Override public SecurityGroup convert(@Nonnull SecurityGroupRequest source) { SecurityGroup entity = new SecurityGroup(); entity.setName(missingResourceNameGenerator.generateName(APIResourceType.SECURITY_GROUP)); entity.setSecurityGroupIds(convertSecurityGroupIdsToList(source)); entity.setSecurityRules(convertSecurityRules(source.getSecurityRules(), entity)); return entity; }  }
SecurityGroupRequestToSecurityGroupConverter implements Converter<SecurityGroupRequest, SecurityGroup> { @Override public SecurityGroup convert(@Nonnull SecurityGroupRequest source) { SecurityGroup entity = new SecurityGroup(); entity.setName(missingResourceNameGenerator.generateName(APIResourceType.SECURITY_GROUP)); entity.setSecurityGroupIds(convertSecurityGroupIdsToList(source)); entity.setSecurityRules(convertSecurityRules(source.getSecurityRules(), entity)); return entity; }  @Override SecurityGroup convert(@Nonnull SecurityGroupRequest source); }
SecurityGroupRequestToSecurityGroupConverter implements Converter<SecurityGroupRequest, SecurityGroup> { @Override public SecurityGroup convert(@Nonnull SecurityGroupRequest source) { SecurityGroup entity = new SecurityGroup(); entity.setName(missingResourceNameGenerator.generateName(APIResourceType.SECURITY_GROUP)); entity.setSecurityGroupIds(convertSecurityGroupIdsToList(source)); entity.setSecurityRules(convertSecurityRules(source.getSecurityRules(), entity)); return entity; }  @Override SecurityGroup convert(@Nonnull SecurityGroupRequest source);  }