@Test
public void loadHostOverprovisioningFactorsTest() {

    HostResources hostResources = new HostResources();
    ConfigurationVO configurationVOCpu = Mockito.mock(ConfigurationVO.class);
    ConfigurationVO configurationVOMem = Mockito.mock(ConfigurationVO.class);
    Mockito.when(configurationDao.findByName("cpu.overprovisioning.factor")).thenReturn(configurationVOCpu);
    Mockito.when(configurationVOCpu.getValue()).thenReturn("1.5");
    Mockito.when(configurationDao.findByName("mem.overprovisioning.factor")).thenReturn(configurationVOMem);
    Mockito.when(configurationVOMem.getValue()).thenReturn("2.0");
    hostResourcesService.loadHostOverprovisioningFactors(hostResources);
    Assert.assertEquals(1.5, hostResources.getCpuOverprovisioning(), 0f);
    Assert.assertEquals(2.0, hostResources.getMemoryOverprovisioning(), 0f);
}