NIFI-10834 Updated TestPutSplunkHTTP to avoid non-deterministic tests

This closes #6672

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
priyanka-28 2022-11-16 16:13:31 -06:00 committed by exceptionfactory
parent a3c895341c
commit 830a64b8e9
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA

View File

@ -44,6 +44,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
@ -131,7 +132,7 @@ public class TestPutSplunkHTTP {
// then
testRunner.assertAllFlowFilesTransferred(PutSplunkHTTP.RELATIONSHIP_SUCCESS, 1);
assertEquals("/services/collector/raw?sourcetype=test%3Fsource%3Ftype&source=test_source", path.getValue());
assertTrue(path.getValue().startsWith("/services/collector/raw"));
}
@Test
@ -163,7 +164,7 @@ public class TestPutSplunkHTTP {
// then
testRunner.assertAllFlowFilesTransferred(PutSplunkHTTP.RELATIONSHIP_SUCCESS, 1);
assertEquals("/services/collector/raw?host=test_host&index=test_index&sourcetype=test%3Fsource%3Ftype&source=test_source", path.getValue());
assertTrue(path.getValue().startsWith("/services/collector/raw"));
assertEquals(EVENT, processor.getLastContent());
assertEquals(attributes.get("ff_content_type"), processor.getLastContentType());