@Test(groups = "unit", testName = "FindSecurityGroupOrCreateTest")
public class FindSecurityGroupOrCreateTest {
@Test
public void testLoad() throws UnknownHostException {
final CloudStackApi client = createMock(CloudStackApi.class);
SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
ZoneApi zoneClient = createMock(ZoneApi.class);
AsyncJobApi jobClient = createMock(AsyncJobApi.class);
SecurityGroup group = createMock(SecurityGroup.class);
Zone zone = createMock(Zone.class);
expect(group.getIngressRules()).andReturn(ImmutableSet.<IngressRule> of());
expect(group.getId()).andReturn("sec-1234").anyTimes();
expect(zone.isSecurityGroupsEnabled()).andReturn(true);
expect(client.getSecurityGroupApi()).andReturn(secClient)
.anyTimes();
expect(client.getZoneApi()).andReturn(zoneClient);
expect(client.getAsyncJobApi()).andReturn(jobClient).anyTimes();
expect(zoneClient.getZone("zone-1")).andReturn(zone);
expect(secClient.getSecurityGroupByName("group-1")).andReturn(null);
expect(secClient.createSecurityGroup("group-1")).andReturn(group);
expect(secClient.authorizeIngressPortsToCIDRs("sec-1234",