@Test public void ensureHealthy_happyDay_whenGMExceptionWasThrown() throws Exception { when(reader.readLine()).thenReturn("NG"); try { sut.execute(gmCommand); // SUPPRESS CHECKSTYLE EmptyBlock BECAUSE test } catch (GMException e) { } sut.ensureHealthy(); }
@Test public void ensureHealthy_happyDay_whenErrorWasThrown() throws Exception { when(reader.readLine()).thenThrow(new Error()); try { sut.execute(gmCommand); // SUPPRESS CHECKSTYLE EmptyBlock BECAUSE test } catch (Error e) { } exception.expect(GMServiceException.class); sut.ensureHealthy(); }
private void ensureHealthy_happyDay(int count) throws Exception { when(reader.readLine()).thenReturn("OK"); for (int i = 0; i < count; i++) sut.execute(gmCommand); sut.ensureHealthy(); }