SecurityGroupExtension extension = orderedRequestsSendResponses(
ImmutableList.of(addRule, queryAsyncJobResultAuthorizeIngress, getWithRule),
ImmutableList.of(addRuleResponse, queryAsyncJobResultAuthorizeIngressResponse, getWithRuleResponse)
).getSecurityGroupExtension().get();
SecurityGroup origGroup = new SecurityGroupBuilder().id("13").build();
SecurityGroup newGroup = extension.addIpPermission(IpProtocol.UDP, 11, 11, emptyMultimap(),
ImmutableSet.of("1.1.1.1/24"), emptyStringSet(), origGroup);
assertEquals(1, newGroup.getIpPermissions().size());
IpPermission newPerm = Iterables.getOnlyElement(newGroup.getIpPermissions());
assertNotNull(newPerm);
assertEquals(newPerm.getIpProtocol(), IpProtocol.UDP);
assertEquals(newPerm.getFromPort(), 11);
assertEquals(newPerm.getToPort(), 11);