+ @Test
+ public void getIncomingEvents_should_success_when_no_errors_encountered() {
+
+ List<String> testResult = newArrayList("test-result1", "test-result2", "test-result3");
+ when(mockConsumer.fetch(anyInt(), anyInt())).thenReturn(testResult);
+
+ List<String> result = adapter.getIncomingEvents(5);
+
+ for (int i = 0; i < testResult.size(); i++) {
+ assertEquals(testResult.get(i), result.get(i));
+ }
+ }
+
+
+ @Test
+ public void postStatus_should_success_when_no_errors_encountered() {
+
+ adapter.postStatus("test-partition", "test-event");
+ verify(mockProducer).post("test-partition", "test-event");
+
+ adapter.postStatus("test-event");
+ verify(mockProducer).post(null, "test-event");
+ }
+
+
+ @Test
+ public void closeClients_should_close_producer_and_consumer() {
+ adapter.getIncomingEvents(5);
+ adapter.postStatus("test-partition", "test-event");
+
+ adapter.closeClients();
+ verify(mockConsumer).close();
+ verify(mockProducer).close();
+ }
+
+