Source:
<code>public void testCreateUpdateAndDeleteSecurityGroup() { for (String region : api.getConfiguredRegions()) { SecurityGroupApi sgApi = null; Rule rule = null; SecurityGroup securityGroup = null; try { sgApi = api.getSecurityGroupApi(region).get(); securityGroup = sgApi.create( SecurityGroup.createOptions().name("jclouds-test").description("jclouds test security group") .build()); assertNotNull(securityGroup); rule = sgApi.create( Rule.createOptions(RuleDirection.EGRESS, securityGroup.getId()) .ethertype(RuleEthertype.IPV6) .portRangeMax(90) .portRangeMin(80) .protocol(RuleProtocol.TCP) .build()); assertNotNull(rule); securityGroup = sgApi.getSecurityGroup(securityGroup.getId()); assertEquals(securityGroup.getName(), "jclouds-test"); assertEquals(securityGroup.getDescription(), "jclouds test security group"); <START> assertEquals(securityGroup.getRules().size(), 3); <END> Rule newSecGroupRule = null; for (Rule sgr : securityGroup.getRules()) { if (sgr.getId().equals(rule.getId())) { newSecGroupRule = sgr; break; } } assertNotNull(newSecGroupRule, "Did not find the new rule in the group."); assertEquals(rule, newSecGroupRule); assertEquals(rule.getEthertype(), RuleEthertype.IPV6); assertEquals(rule.getProtocol(), RuleProtocol.TCP); assertEquals(rule.getPortRangeMax().intValue(), 90); assertEquals(rule.getPortRangeMin().intValue(), 80); assertEquals(rule.getDirection(), RuleDirection.EGRESS); } finally { try { assertTrue(sgApi.deleteRule(rule.getId())); } finally { assertTrue(sgApi.deleteSecurityGroup(securityGroup.getId())); } } } }</code><technical_language>assertEquals(securityGroup.getRules().size(), 3, "Expected 3 default rules"); line 54..</technical_language>

Target:
public void testCreateUpdateAndDeleteSecurityGroup() { for (String region : api.getConfiguredRegions()) { SecurityGroupApi sgApi = null; Rule rule = null; SecurityGroup securityGroup = null; try { sgApi = api.getSecurityGroupApi(region).get(); securityGroup = sgApi.create( SecurityGroup.createBuilder().name("jclouds-test").description("jclouds test security group") .build()); assertNotNull(securityGroup); rule = sgApi.create( Rule.createBuilder(RuleDirection.EGRESS, securityGroup.getId()) .ethertype(RuleEthertype.IPV6) .portRangeMax(90) .portRangeMin(80) .protocol(RuleProtocol.TCP) .build()); assertNotNull(rule); securityGroup = sgApi.getSecurityGroup(securityGroup.getId()); assertEquals(securityGroup.getName(), "jclouds-test"); assertEquals(securityGroup.getDescription(), "jclouds test security group"); assertEquals(securityGroup.getRules().size(), 3); Rule newSecGroupRule = null; for (Rule sgr : securityGroup.getRules()) { if (sgr.getId().equals(rule.getId())) { newSecGroupRule = sgr; break; } } assertNotNull(newSecGroupRule, "Did not find the new rule in the group."); assertEquals(rule, newSecGroupRule); assertEquals(rule.getEthertype(), RuleEthertype.IPV6); assertEquals(rule.getProtocol(), RuleProtocol.TCP); assertEquals(rule.getPortRangeMax().intValue(), 90); assertEquals(rule.getPortRangeMin().intValue(), 80); assertEquals(rule.getDirection(), RuleDirection.EGRESS); } finally { try { assertTrue(sgApi.deleteRule(rule.getId())); } finally { assertTrue(sgApi.deleteSecurityGroup(securityGroup.getId())); } } } }