@Test public void theEmitterShouldReturnAnEmptyListOnSuccess() { String url = MOCKED_HOST + MOCKED_COLLECTION; List<String> messages = new ArrayList<String>(); messages.add("This is message #1"); messages.add("This is message #2"); messages.add("This is message #3"); messages.add("This is message #4"); SumologicEmitter emitter = new SumologicEmitter(url); List<String> notEmittedMessages = emitter.sendBatchConcatenating(messages); Assert.assertEquals(0, notEmittedMessages.size()); }
@Test public void theEmitterShouldReturnTheListParameterWhenFailing() { String url = MOCKED_HOST + "/sumologic/collections/fake-url"; List<String> messages = new ArrayList<String>(); messages.add("This is message #1"); messages.add("This is message #2"); messages.add("This is message #3"); messages.add("This is message #4"); SumologicEmitter emitter = new SumologicEmitter(url); List<String> notEmittedMessages = emitter.sendBatchConcatenating(messages); Assert.assertEquals(messages, notEmittedMessages); }