@Test
public void deploySystemVmWithJavaTest() {

    AutonomiccsSystemVm vmInstance = Mockito.mock(AutonomiccsSystemVm.class);
    Mockito.doReturn(vmInstance).when(spy).deploySystemVm(Mockito.anyLong(), Mockito.any(SystemVmType.class));
    Mockito.doReturn("managementIp").when(vmInstance).getManagementIpAddress();
    Mockito.doNothing().when(sshUtils).executeCommandOnHostViaSsh(Mockito.eq("managementIp"), Mockito.eq("aptitude update"));
    Mockito.doNothing().when(sshUtils).executeCommandOnHostViaSsh(Mockito.eq("managementIp"), Mockito.eq(commandToInstallOpenJDK7));
    AutonomiccsSystemVm result = spy.deploySystemVmWithJava(0l, SystemVmType.ClusterManagerStartHostService);
    Mockito.verify(spy).deploySystemVm(Mockito.anyLong(), Mockito.any(SystemVmType.class));
    Mockito.verify(vmInstance).getManagementIpAddress();
    Mockito.verify(sshUtils).executeCommandOnHostViaSsh(Mockito.eq("managementIp"), Mockito.eq("aptitude update"));
    Mockito.verify(sshUtils).executeCommandOnHostViaSsh(Mockito.eq("managementIp"), Mockito.eq(commandToInstallOpenJDK7));
    Assert.assertEquals(vmInstance, result);
}