Commits

Micha Kops committed 25ea140

HTTP header verification example added

  • Participants
  • Parent commits 235fe55

Comments (0)

Files changed (2)

File src/main/java/com/hascode/ra_samples/RestAssuredSampleService.java

 		return headerParam;
 	}
 
+	@GET
+	@Produces(MediaType.TEXT_PLAIN)
+	@Path("/header/multiple")
+	public Response multipleHeader() {
+		return Response.ok().header("customHeader1", "foo")
+				.header("anotherHeader", "bar").build();
+	}
+
+	// TODO:
+	// Setting the Content Type
+	// Verifying the Content Type
+	// Setting Cookies
+	// Verifying Cookies
+	// Specifying Path Parameters
+	// File Uploads
+	// Registering custom parsers for MIME-types
+	// Setting default values
+	// Specification reuse
+
 }

File src/test/java/it/RestAssuredSampleServiceIT.java

 		expect().body(equalTo("foo")).when().with().header("myparam", "foo")
 				.get("/ra/service/header/print");
 	}
+
+	@Test
+	public void testReturnedHeaders() {
+		expect().headers("customHeader1", "foo", "anotherHeader", "bar").when()
+				.get("/ra/service/header/multiple");
+	}
 }