@Test
public void createRegisterTemplateCommandForHypervisorTest() {

    Map<Object, Object> details = new HashMap<>();
    Mockito.doReturn("return").when(autonomiccsSystemVmTemplateService).getAutonomiccsSystemVmTemplateDisplayText(Mockito.any(HypervisorType.class));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("displayText"), Mockito.anyString());
    Mockito.doReturn("return").when(spy).getSupportedImageFormat(Mockito.any(HypervisorType.class));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("format"), Mockito.anyString());
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("hypervisor"), Mockito.eq("Any"));
    Mockito.doReturn("return").when(autonomiccsSystemVmTemplateService).getAutonomiccsSystemVmTemplateName(Mockito.any(HypervisorType.class));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("templateName"), Mockito.anyString());
    Mockito.doReturn(0l).when(guestOsService).getGuestOsUuid(Mockito.anyString());
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("osTypeId"), Mockito.anyLong());
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("zoneId"), Mockito.eq(allAvailableZoneMagicNumber));
    Mockito.doReturn("return").when(autonomiccsSystemVmTemplateService).getSystemVmTemplateUrl(Mockito.any(HypervisorType.class));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("url"), Mockito.anyString());
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("accountName"), Mockito.eq("system"));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("domainId"), Mockito.eq(systemAccountDomainId));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("projectId"), Mockito.eq(null));
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("requiresHvm"), Mockito.eq(false));
    Mockito.doReturn(details).when(spy).createTemplateDetails();
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("details"), Matchers.<Map<Object, Object>> any());
    Mockito.doNothing().when(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("_accountService"), Mockito.eq(accountService));
    spy.createRegisterTemplateCommandForHypervisor(HypervisorType.Any);
    Mockito.verify(autonomiccsSystemVmTemplateService).getAutonomiccsSystemVmTemplateDisplayText(Mockito.any(HypervisorType.class));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("displayText"), Mockito.anyString());
    Mockito.verify(spy).getSupportedImageFormat(Mockito.any(HypervisorType.class));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("format"), Mockito.anyString());
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("hypervisor"), Mockito.eq("Any"));
    Mockito.verify(autonomiccsSystemVmTemplateService).getAutonomiccsSystemVmTemplateName(Mockito.any(HypervisorType.class));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("templateName"), Mockito.anyString());
    Mockito.verify(guestOsService).getGuestOsUuid(Mockito.eq(guestOsName));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("osTypeId"), Mockito.anyLong());
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("zoneId"), Mockito.eq(allAvailableZoneMagicNumber));
    Mockito.verify(autonomiccsSystemVmTemplateService).getSystemVmTemplateUrl(Mockito.any(HypervisorType.class));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("url"), Mockito.anyString());
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("accountName"), Mockito.eq("system"));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("domainId"), Mockito.eq(systemAccountDomainId));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("projectId"), Mockito.eq(null));
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("requiresHvm"), Mockito.eq(false));
    Mockito.verify(spy).createTemplateDetails();
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("details"), Matchers.<Map<Object, Object>> any());
    Mockito.verify(reflectionUtils).setFieldIntoObject(Mockito.any(RegisterTemplateCmd.class), Mockito.eq("_accountService"), Mockito.eq(accountService));
}