diff options
author | Lee, Tian (tl5884) <TianL@amdocs.com> | 2018-10-09 13:00:39 +0100 |
---|---|---|
committer | Lee, Tian (tl5884) <TianL@amdocs.com> | 2018-10-09 13:00:39 +0100 |
commit | b28b902cbd478816290a098e80c96e33ac570309 (patch) | |
tree | ad815bee3b1031d0635b62290ba23de41d5fa20a | |
parent | a14cb8993b3fcbf7f92770d4f326288a65089991 (diff) |
Enhance fproxy unit tests
Ensure that the fproxy unit tests are specifically testing the
propagation of the X-TransactionId header in downstream requests.
Change-Id: I5e2da81eacaaf2f30e08b2cb95a12049fd5da6ff
Issue-ID: AAF-529
Signed-off-by: Lee, Tian (tl5884) <TianL@amdocs.com>
-rw-r--r-- | sidecar/fproxy/src/test/java/org/onap/aaf/fproxy/FProxyServiceTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sidecar/fproxy/src/test/java/org/onap/aaf/fproxy/FProxyServiceTest.java b/sidecar/fproxy/src/test/java/org/onap/aaf/fproxy/FProxyServiceTest.java index ccf13e9..e78d48b 100644 --- a/sidecar/fproxy/src/test/java/org/onap/aaf/fproxy/FProxyServiceTest.java +++ b/sidecar/fproxy/src/test/java/org/onap/aaf/fproxy/FProxyServiceTest.java @@ -76,11 +76,14 @@ public class FProxyServiceTest { public void testRequestFrowarding() throws Exception { String testUrl = "https://localhost:80/testurl"; String testResponse = "Response from MockRestService"; + String testTransactionId = "63f88b50-6345-4a61-bc59-3a48cabb60a4"; mockServer.expect(requestTo(testUrl)).andExpect(method(HttpMethod.GET)) + .andExpect(header(transactionIdHeaderName, testTransactionId)) .andRespond(withSuccess(testResponse, MediaType.APPLICATION_JSON)); - mvc.perform(MockMvcRequestBuilders.get(testUrl).accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + mvc.perform(MockMvcRequestBuilders.get(testUrl).accept(MediaType.APPLICATION_JSON) + .header(transactionIdHeaderName, testTransactionId)).andExpect(status().isOk()) .andExpect(content().string(equalTo(testResponse))); mockServer.verify(); @@ -105,6 +108,7 @@ public class FProxyServiceTest { // Expect mock server to be called with request containing cached header mockServer.expect(requestTo(testUrl)).andExpect(method(HttpMethod.GET)) + .andExpect(header(transactionIdHeaderName, testTransactionId)) .andExpect(header(headerName, headerValue)) .andRespond(withSuccess(testResponse, MediaType.APPLICATION_JSON)); |