AutonomiccsSystemVmDeploymentService implements InitializingBean { protected String getVirtualMachineInstanceSuffix() { Map<String, String> configs = getConfigurationsFromDatabase(); return configs.get("instance.name"); }  HostVO searchForRandomHostInCloudToDeployAutonomiccsSystemVm(); HostVO searchForRandomHostInPodToDeployAutonomiccsSystemVm(HostPodVO pod); HostVO searchForAnotherRandomHostToStartSystemVm(VMInstanceVO vmInstance); AutonomiccsSystemVm deploySystemVmWithJava(Long hostId, SystemVmType systemVmType); @Override void afterPropertiesSet();  }
@Test public void getVirtualMachineInstanceSuffixTest() { Map<String, String> configs = new HashMap<>(); configs.put("instance.name", "value"); Mockito.doReturn(configs).when(spy).getConfigurationsFromDatabase(); String result = spy.getVirtualMachineInstanceSuffix(); Assert.assertEquals("value", result); }