@Test
  public void registratorStartInClusterWhenEverythingWorksFine() throws Exception {
    when(registratorBootstrap.call()).thenReturn(true);
    doReturn(registratorBootstrap)
        .when(underTestSpy)
        .registratorBootstrap(any(GatewayConfig.class), anyString(), any(Node.class));

    underTestSpy.startRegistrator(
        containerOrchestratorCluster(gatewayConfig(), generateNodes(FIX_NODE_COUNT)),
        new ContainerConfig("registrator", "0.0.1"),
        exitCriteriaModel());
  }
  @Test(expected = CloudbreakOrchestratorFailedException.class)
  public void registratorStartInClusterWhenNullPointerOccurredAndOrchestratorFailedComes()
      throws Exception {
    when(registratorBootstrap.call()).thenThrow(new NullPointerException("null"));
    doReturn(registratorBootstrap)
        .when(underTestSpy)
        .registratorBootstrap(any(GatewayConfig.class), anyString(), any(Node.class));

    underTestSpy.startRegistrator(
        containerOrchestratorCluster(gatewayConfig(), generateNodes(FIX_NODE_COUNT)),
        new ContainerConfig("registrator", "0.0.1"),
        exitCriteriaModel());
  }
  @Test
  public void kerberosServerStartInClusterWhenNullPointerOccurredAndOrchestratorFailedComes()
      throws Exception {
    when(registratorBootstrap.call()).thenThrow(new NullPointerException("null"));
    doReturn(kerberosServerBootstrap)
        .when(underTestSpy)
        .kerberosServerBootstrap(
            any(KerberosConfiguration.class),
            any(GatewayConfig.class),
            anyString(),
            any(Node.class),
            any(LogVolumePath.class));

    underTestSpy.startKerberosServer(
        containerOrchestratorCluster(gatewayConfig(), generateNodes(FIX_NODE_COUNT)),
        new ContainerConfig("bserver", "0.0.1"),
        generateLogVolume(),
        new KerberosConfiguration("", "", ""),
        exitCriteriaModel());
  }