Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

expected content type failure when there is no body #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Run this test:

  expect().contentType(ContentType.JSON).when().get("test");

What is the expected output? What do you see instead?

  If no body is returned but there is a response header with the content type an exception will be produced indicating that the expected content type was not received. It says the content type is an empty string.

What version of the product are you using? On what operating system?

  1.6.3-SNAPSHOT from https://oss.sonatype.org/content/repositories/snapshots/

Please provide any additional information below.

  The problem lies in the class HttpResponseContentTypeFinder. This class does not return the actual content type when there is no body. I guess this is wrong.

Original issue reported on code.google.com by the...@gmail.com on 24 Aug 2012 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 25 Sep 2012 at 6:07

GoogleCodeExporter commented 9 years ago
I can't reproduce this. I have a scalatra resource that looks like this:

get("/contentTypeButNoBody") {
    contentType = "application/json"
  }

and my tests looks like this:

expect().contentType("application/json").when().get("/contentTypeButNoBody");

And it works..

Original comment by johan.ha...@gmail.com on 11 Oct 2012 at 7:11

GoogleCodeExporter commented 9 years ago
Closing due to no activity from reporter.

Original comment by johan.ha...@gmail.com on 19 Nov 2013 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 19 Nov 2013 at 6:59