|
18 | 18 |
|
19 | 19 | import static org.junit.Assert.assertEquals; |
20 | 20 | import static org.junit.Assert.assertNotNull; |
| 21 | +import static org.junit.Assert.assertNull; |
21 | 22 | import static org.ops4j.pax.exam.CoreOptions.mavenBundle; |
22 | 23 | import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; |
23 | 24 |
|
@@ -102,12 +103,17 @@ public void testUriCompliance() throws Exception { |
102 | 103 | assertEquals(200, response.getStatus()); |
103 | 104 | assertEquals("OK", response.getContentAsString()); |
104 | 105 |
|
| 106 | + // Validate custom headers in case of success page, should not be present |
| 107 | + assertNull(response.getHeaders().get("Strict-Transport-Security")); |
| 108 | + assertNull(response.getHeaders().get("X-Custom-Header")); |
| 109 | + |
| 110 | + |
105 | 111 | // blocked with HTTP 400 by default |
106 | 112 | // validate custom headers in case of error page |
107 | | - ContentResponse responseAmbigousPath = httpClient.GET(destUriAmbigousPath); |
108 | | - assertEquals(400, responseAmbigousPath.getStatus()); |
109 | | - assertEquals("max-age=31536000", responseAmbigousPath.getHeaders().get("Strict-Transport-Security")); |
110 | | - assertEquals("123", responseAmbigousPath.getHeaders().get("X-Custom-Header")); |
| 113 | + ContentResponse responseAmbiguousPath = httpClient.GET(destUriAmbigousPath); |
| 114 | + assertEquals(400, responseAmbiguousPath.getStatus()); |
| 115 | + assertEquals("max-age=31536000", responseAmbiguousPath.getHeaders().get("Strict-Transport-Security")); |
| 116 | + assertEquals("123", responseAmbiguousPath.getHeaders().get("X-Custom-Header")); |
111 | 117 |
|
112 | 118 | httpClient.close(); |
113 | 119 | } |
|
0 commit comments