@Test public void testConvertWhenSecurityGroupIsNullThenSecurityShouldContainsEmptyRulesInGroup() { Set<InstanceGroup> instanceGroups = new LinkedHashSet<>(); InstanceGroup instanceGroup = mock(InstanceGroup.class); instanceGroups.add(instanceGroup); Template template = mock(Template.class); when(instanceGroup.getTemplate()).thenReturn(template); when(instanceGroup.getStack()).thenReturn(stack); when(instanceGroup.getSecurityGroup()).thenReturn(null); when(stack.getInstanceGroupsAsList()).thenReturn(new ArrayList<>(instanceGroups)); CloudStack result = underTest.convert(stack); assertEquals(1L, result.getGroups().size()); assertTrue(result.getGroups().get(0).getSecurity().getRules().isEmpty()); assertNull(result.getGroups().get(0).getSecurity().getCloudSecurityId()); }
public CloudStack convert(Stack stack) { return convert(stack, Collections.emptySet()); }
StackToCloudStackConverter { public CloudStack convert(Stack stack) { return convert(stack, Collections.emptySet()); } }
StackToCloudStackConverter { public CloudStack convert(Stack stack) { return convert(stack, Collections.emptySet()); }  }
StackToCloudStackConverter { public CloudStack convert(Stack stack) { return convert(stack, Collections.emptySet()); }  CloudStack convert(Stack stack); CloudStack convertForDownscale(Stack stack, Set<String> deleteRequestedInstances); CloudStack convertForTermination(Stack stack, String instanceId); CloudStack convert(Stack stack, Collection<String> deleteRequestedInstances); List<CloudInstance> buildInstances(Stack stack); CloudInstance buildInstance(InstanceMetaData instanceMetaData, InstanceGroup instanceGroup,
            StackAuthentication stackAuthentication, Long privateId, InstanceStatus status); Map<String, Object> buildCloudInstanceParameters(String environmentCrn, InstanceMetaData instanceMetaData, CloudPlatform platform); }
StackToCloudStackConverter { public CloudStack convert(Stack stack) { return convert(stack, Collections.emptySet()); }  CloudStack convert(Stack stack); CloudStack convertForDownscale(Stack stack, Set<String> deleteRequestedInstances); CloudStack convertForTermination(Stack stack, String instanceId); CloudStack convert(Stack stack, Collection<String> deleteRequestedInstances); List<CloudInstance> buildInstances(Stack stack); CloudInstance buildInstance(InstanceMetaData instanceMetaData, InstanceGroup instanceGroup,
            StackAuthentication stackAuthentication, Long privateId, InstanceStatus status); Map<String, Object> buildCloudInstanceParameters(String environmentCrn, InstanceMetaData instanceMetaData, CloudPlatform platform);  }