@Test(expected = CloudbreakOrchestratorFailedException.class) public void logRotateStartInClusterWhenOrchestratorFailed() throws Exception { when(logrotateBootsrap.call()).thenThrow(new CloudbreakOrchestratorFailedException("failed")); doReturn(logrotateBootsrap) .when(underTestSpy) .logrotateBootsrap(any(GatewayConfig.class), anyString(), any(Node.class), anyString()); underTestSpy.startLogrotate( containerOrchestratorCluster(gatewayConfig(), generateNodes(FIX_NODE_COUNT)), new ContainerConfig("rotate", "0.0.1"), exitCriteriaModel()); }
@Test public void logRotateStartInClusterWhenEverythingWorksFine() throws Exception { when(logrotateBootsrap.call()).thenReturn(true); doReturn(logrotateBootsrap) .when(underTestSpy) .logrotateBootsrap(any(GatewayConfig.class), anyString(), any(Node.class), anyString()); underTestSpy.startLogrotate( containerOrchestratorCluster(gatewayConfig(), generateNodes(FIX_NODE_COUNT)), new ContainerConfig("rotate", "0.0.1"), exitCriteriaModel()); }