Skip to content

Commit

Permalink
RESTEASY-1251: Fixed two tests that were broken by Response.getEntity()
Browse files Browse the repository at this point in the history
following Response.readEntity().
  • Loading branch information
ronsigal committed Feb 18, 2016
1 parent b064a46 commit 34a8bd9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public void testPriority() throws Exception
client.register(ClientRequestFilterMax.class);

Response response = client.target(generateURL("/test")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("test", response.getEntity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.jboss.resteasy.test.EmbeddedContainer;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import junit.framework.Assert;
Expand Down Expand Up @@ -130,6 +129,7 @@ public void testByte() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Byte")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -141,6 +141,7 @@ public void testBytePrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/byte")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -152,6 +153,7 @@ public void testDouble() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Double")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123.4", response.getEntity());
Expand All @@ -163,6 +165,7 @@ public void testDoublePrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/double")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123.4", response.getEntity());
Expand All @@ -174,6 +177,7 @@ public void testFloat() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Float")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123.4", response.getEntity());
Expand All @@ -185,6 +189,7 @@ public void testFloatPrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/float")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123.4", response.getEntity());
Expand All @@ -196,6 +201,7 @@ public void testInteger() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Integer")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -207,6 +213,7 @@ public void testIntegerPrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/integer")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -218,6 +225,7 @@ public void testLong() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Long")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -229,6 +237,7 @@ public void testLongPrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/long")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -240,6 +249,7 @@ public void testShort() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/Short")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -251,6 +261,7 @@ public void testShortPrimitive() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/short")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -262,6 +273,7 @@ public void testBigDecimal() throws Exception
{
Client client = ClientBuilder.newClient();
Response response = client.target(generateURL("/test/bigDecimal")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand All @@ -274,6 +286,7 @@ public void testProviderGetsUsed() throws Exception
Client client = ClientBuilder.newClient();
client.register(MyDefaultNumberWriter.class);
Response response = client.target(generateURL("/test/bigDecimal")).request().get();
response.bufferEntity();
System.out.println(response.readEntity(String.class));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("123", response.getEntity());
Expand Down

0 comments on commit 34a8bd9

Please sign in to comment.