@Test public void testProviderEntriesToStackResponseMultipleInstanceGroup() { Stack stack = new Stack(); stack.setCluster(new Cluster()); Set<InstanceGroup> instanceGroups = getInstanceGroups(new InstanceMetaData()); instanceGroups.addAll(getInstanceGroups(new InstanceMetaData())); stack.setInstanceGroups(instanceGroups); StackV4Response actual = underTest.providerEntriesToStackResponse(stack, new StackV4Response()); Assert.assertEquals(2L, actual.getHardwareInfoGroups().size()); }
@Override public StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse) { Set<HardwareInfoGroupV4Response> hardwareInfoResponses = stack.getInstanceGroups().stream() .map(instanceGroup -> hardwareInfoGroupResponse(stack, instanceGroup)) .collect(Collectors.toSet()); stackResponse.setHardwareInfoGroups(hardwareInfoResponses); return stackResponse; }
StackResponseHardwareInfoProvider implements ResponseProvider { @Override public StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse) { Set<HardwareInfoGroupV4Response> hardwareInfoResponses = stack.getInstanceGroups().stream() .map(instanceGroup -> hardwareInfoGroupResponse(stack, instanceGroup)) .collect(Collectors.toSet()); stackResponse.setHardwareInfoGroups(hardwareInfoResponses); return stackResponse; } }
StackResponseHardwareInfoProvider implements ResponseProvider { @Override public StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse) { Set<HardwareInfoGroupV4Response> hardwareInfoResponses = stack.getInstanceGroups().stream() .map(instanceGroup -> hardwareInfoGroupResponse(stack, instanceGroup)) .collect(Collectors.toSet()); stackResponse.setHardwareInfoGroups(hardwareInfoResponses); return stackResponse; }  }
StackResponseHardwareInfoProvider implements ResponseProvider { @Override public StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse) { Set<HardwareInfoGroupV4Response> hardwareInfoResponses = stack.getInstanceGroups().stream() .map(instanceGroup -> hardwareInfoGroupResponse(stack, instanceGroup)) .collect(Collectors.toSet()); stackResponse.setHardwareInfoGroups(hardwareInfoResponses); return stackResponse; }  @Override StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse); @Override String type(); }
StackResponseHardwareInfoProvider implements ResponseProvider { @Override public StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse) { Set<HardwareInfoGroupV4Response> hardwareInfoResponses = stack.getInstanceGroups().stream() .map(instanceGroup -> hardwareInfoGroupResponse(stack, instanceGroup)) .collect(Collectors.toSet()); stackResponse.setHardwareInfoGroups(hardwareInfoResponses); return stackResponse; }  @Override StackV4Response providerEntriesToStackResponse(Stack stack, StackV4Response stackResponse); @Override String type();  }