@Test public void testConvertWhenInstanceGroupContainsTemplateAndThereIsANotDeletedInstanceMetaThenInstancesShoulContainsExpectedAmountOfElements() { Set<InstanceGroup> instanceGroups = new LinkedHashSet<>(); InstanceGroup instanceGroup = mock(InstanceGroup.class); Template template = new Template(); template.setVolumeTemplates(Sets.newHashSet()); instanceGroups.add(instanceGroup); InstanceMetaData metaData = new InstanceMetaData(); String fqdnParsedName = "test1-m-1-20180605095019"; metaData.setId(1L); metaData.setDiscoveryFQDN(String.format("%s.project.id", fqdnParsedName)); metaData.setSubnetId(TEST_STRING_ID); metaData.setInstanceName(TEST_NAME); Set<InstanceMetaData> notDeletedMetas = new LinkedHashSet<>(); notDeletedMetas.add(metaData); when(instanceGroup.getTemplate()).thenReturn(template); when(instanceGroup.getNotDeletedInstanceMetaDataSet()).thenReturn(notDeletedMetas); when(instanceGroup.getStack()).thenReturn(stack); when(stack.getInstanceGroupsAsList()).thenReturn(new ArrayList<>(instanceGroups)); CloudStack result = underTest.convert(stack); assertEquals(1L, result.getGroups().size()); assertEquals(1L, result.getGroups().get(0).getInstances().size()); assertEquals(fqdnParsedName, result.getGroups().get(0).getInstances().get(0).getParameters().get(CloudInstance.DISCOVERY_NAME)); assertEquals(metaData.getSubnetId(), result.getGroups().get(0).getInstances().get(0).getParameters().get(CloudInstance.SUBNET_ID)); assertEquals(metaData.getInstanceName(), result.getGroups().get(0).getInstances().get(0).getParameters().get(CloudInstance.INSTANCE_NAME)); }
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);  }