@Test
 public void testTransformModifiesOutboundValue() throws Exception {
   HttpAction<HttpGet> action = get("/constraint/ONE/TWO");
   Assert.assertEquals(
       action.getContextPath() + "/outbound/three",
       action.getResponseHeaderValues("three").get(0));
 }
예제 #2
0
 @Test
 public void testPipelineWithTwoTransformers() throws Exception {
   HttpAction<HttpGet> action = get("/test.two");
   assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
   assertEquals("THIS IS BAR", action.getResponseContent());
 }
예제 #3
0
 @Test
 public void testPipelineWithOneTransformer() throws Exception {
   HttpAction<HttpGet> action = get("/test.one");
   assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
   assertEquals("this is bar", action.getResponseContent());
 }
 @Test
 public void testTransformModifiesIncomingValue() throws Exception {
   HttpAction<HttpGet> action = get("/constraint/ONE/TWO");
   Assert.assertEquals("ONE", action.getResponseHeaderValues("one").get(0));
   Assert.assertEquals("two", action.getResponseHeaderValues("two").get(0));
 }
 @Test
 public void testSatisfiedConstraintPreventsRuleExecution() throws Exception {
   HttpAction<HttpGet> action = get("/constraint/ONE/TWO");
   Assert.assertEquals(211, action.getResponse().getStatusLine().getStatusCode());
 }
예제 #6
0
 @Test
 public void testResourceParamReadsForNotMatchingCondition() throws Exception {
   HttpAction<HttpGet> action = get("/missing.bah");
   Assert.assertEquals(404, action.getResponse().getStatusLine().getStatusCode());
 }
예제 #7
0
 @Test
 public void testResourceParamReadsForMissingParameter() throws Exception {
   HttpAction<HttpGet> action = get("/file.bah");
   Assert.assertEquals(211, action.getResponse().getStatusLine().getStatusCode());
 }
예제 #8
0
 @Test
 public void testResourceParamForMatchingCondition() throws Exception {
   HttpAction<HttpGet> action = get("/exists.txt");
   Assert.assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
 }