return input.getId() == group.getId();
}
});
IngressRule ICMPPingRule = Iterables.find(group.getIngressRules(), new Predicate<IngressRule>() {
@Override
public boolean apply(IngressRule input) {
return "icmp".equals(input.getProtocol());
}
});
assert ICMPPingRule.getId() != null : ICMPPingRule;
assert "icmp".equals(ICMPPingRule.getProtocol()) : ICMPPingRule;
assert ICMPPingRule.getStartPort() == -1 : ICMPPingRule;
assert ICMPPingRule.getEndPort() == -1 : ICMPPingRule;
assert ICMPPingRule.getICMPCode() == 0 : ICMPPingRule;
assert ICMPPingRule.getICMPType() == 8 : ICMPPingRule;
assert ICMPPingRule.getAccount() == null : ICMPPingRule;
assert ICMPPingRule.getSecurityGroupName() == null : ICMPPingRule;
assert cidr.equals(ICMPPingRule.getCIDR()) : ICMPPingRule;
IngressRule SSHRule = Iterables.find(group.getIngressRules(), new Predicate<IngressRule>() {
@Override
public boolean apply(IngressRule input) {
return "tcp".equals(input.getProtocol());
}
});
assert SSHRule.getId() != null : SSHRule;
assert "tcp".equals(SSHRule.getProtocol()) : SSHRule;
assert SSHRule.getStartPort() == 22 : SSHRule;
assert SSHRule.getEndPort() == 22 : SSHRule;
assert SSHRule.getICMPCode() == -1 : SSHRule;
assert SSHRule.getICMPType() == -1 : SSHRule;
assert SSHRule.getAccount() == null : SSHRule;
assert SSHRule.getSecurityGroupName() == null : SSHRule;
assert cidr.equals(SSHRule.getCIDR()) : SSHRule;
}