@Test(groups = "contentaware", dependsOnGroups = "passthroughPost") public void messageEchoingFromProcessorTestCase() { String testValue = "Test Message"; try { HttpURLConnection urlConn = TestUtil.request(baseURI, "/", HttpMethod.POST.name(), true); TestUtil.writeContent(urlConn, testValue); assertEquals(200, urlConn.getResponseCode()); String content = TestUtil.getContent(urlConn); assertEquals(testValue, content); urlConn.disconnect(); } catch (IOException e) { LOGGER.error("IO Exception occurred", e); assertTrue(false); } }
@Test(groups = "contentaware", dependsOnMethods = "requestResponseStreamingFromProcessorTestCase") public void requestResponseTransformStreamingFromProcessorTestCase() { String requestValue = "<A><B><C>Test Message</C></B></A>"; try { CarbonMessageProcessor carbonMessageProcessor = new RequestResponseTransformStreamingProcessor(); TestUtil.updateMessageProcessor( carbonMessageProcessor, senderConfiguration, listenerConfiguration); HttpURLConnection urlConn = TestUtil.request(baseURI, "/", HttpMethod.POST.name(), true); TestUtil.writeContent(urlConn, requestValue); assertEquals(200, urlConn.getResponseCode()); String content = TestUtil.getContent(urlConn); assertEquals(requestValue, content); urlConn.disconnect(); } catch (IOException e) { LOGGER.error("IO Exception occurred", e); assertTrue(false); } }