HostProfiler { public ClusterVmProfile createClusterVmsProfile(ClusterVmProfile vmsProfile) { double numberOfInstances = vmsProfile.getNumberOfInstances(); vmsProfile.setCpusProfile(vmsProfile.getTotalCpus() / numberOfInstances); vmsProfile.setCpuSpeedProfile(vmsProfile.getTotalCpuSpeed() / numberOfInstances); vmsProfile.setMemoryProfile(vmsProfile.getTotalMemory() / numberOfInstances); return vmsProfile; } HostProfiler(List<HostResources> hosts); HostProfile hostVMsResourceProportion(HostResources host); ClusterVmProfile createClusterVmsProfile(ClusterVmProfile vmsProfile); ClusterVmProfile getHostsVmsResources();  }
@Test public void createClusterVmsProfileTest() { ClusterVmProfile vmsProfile = spyProfiler.getHostsVmsResources(); ClusterVmProfile result = spyProfiler.createClusterVmsProfile(vmsProfile); Assert.assertEquals(1, result.getCpusProfile(), 0.0); Assert.assertEquals(1000, result.getCpuSpeedProfile(), 0.0); Assert.assertEquals(500, result.getMemoryProfile(), 0.0); }