@Test public void testStatusGetterSetter() { actionEvent.setStatus(Status.BACKOFF); Assert.assertEquals(actionEvent.getStatus(), Status.BACKOFF); actionEvent.setStatus(Status.READY); Assert.assertEquals(actionEvent.getStatus(), Status.READY); }
/** * @formatter:off Assert that getBody returns the same string that was set using setBody method. * Assert that getHeaders returns the same object that was set using setHeaders method. * @formatter:off */ @Test public void testConstructor() { actionEvent.setBody("unit-test-body".getBytes(Charset.defaultCharset())); Map<String, String> headers = new HashMap<>(); actionEvent.setHeaders(headers); ActionEvent newActionEvent = new ActionEvent(actionEvent); Assert.assertEquals(newActionEvent.getHeaders(), headers); Assert.assertEquals(newActionEvent.getStatus(), Status.READY); Assert.assertEquals( newActionEvent.getBody(), "unit-test-body".getBytes(Charset.defaultCharset())); }
@Test public void testNewBackoffEvent() { ActionEvent backoffEvent = ActionEvent.newBackoffEvent(); Assert.assertEquals(backoffEvent.getStatus(), Status.BACKOFF); }