Skip to content

Commit

Permalink
Workaround for tynamo#8
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrygusev committed Apr 1, 2017
1 parent c800336 commit 60eee1c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,14 @@ public void testEchoGenericListOfLongs() throws Exception
Assert.assertEquals(response, "1");
client.close();
}

@Test
public void testEchoGenericListOfLongsWorkaround() throws Exception
{
Client client = ClientBuilder.newClient();
Invocation.Builder builder = client.target(BASEURI + "mycustomresteasyprefix/echo/generic_longs_workaround").request();
String response = builder.post(Entity.json("{\"params\": [1, 2, 3]}"), String.class);
Assert.assertEquals(response, "1");
client.close();
}
}
11 changes: 11 additions & 0 deletions src/test/java/org/tynamo/resteasy/ws/ReloadableEchoResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,15 @@ public interface ReloadableEchoResource
@Consumes("application/json")
@Produces("application/json")
Response genericLongs(List<Long> params);

class GenericLongsRequest
{
public List<Long> params;
}

@POST
@Path("/generic_longs_workaround")
@Consumes("application/json")
@Produces("application/json")
Response genericLongsWorkaround(GenericLongsRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ public Response genericLongs(List<Long> params)
return Response.ok(first).build();
}

@Override
public Response genericLongsWorkaround(GenericLongsRequest request)
{
Long first = request.params.get(0); // OK
return Response.ok(first).build();
}

}

0 comments on commit 60eee1c

Please sign in to comment.