@Test public void testConvertWhenInstanceGroupAttributesIsNotNullThenExpectedMapShouldBeStoredInGroupInstance() { Json attributes = mock(Json.class); Set<InstanceGroup> instanceGroups = new LinkedHashSet<>(); InstanceGroup instanceGroup = mock(InstanceGroup.class); instanceGroups.add(instanceGroup); Template template = new Template(); template.setVolumeTemplates(Sets.newHashSet()); Map<String, Object> expected = createMap(""); when(instanceGroup.getTemplate()).thenReturn(template); when(instanceGroup.getAttributes()).thenReturn(attributes); when(attributes.getMap()).thenReturn(expected); when(instanceGroup.getNotDeletedInstanceMetaDataSet()).thenReturn(Collections.emptySet()); when(instanceGroup.getStack()).thenReturn(stack); when(stack.getInstanceGroupsAsList()).thenReturn(new ArrayList<>(instanceGroups)); CloudStack result = underTest.convert(stack); assertEquals(1L, result.getGroups().size()); assertEquals(expected, result.getGroups().get(0).getParameters()); }
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);  }