jerseyjersey-test-framework

JerseyTest: how to bind to Set<Integer>


When testing with JerseyTest, I am having trouble to bind to a:

@Inject
@SomeQualifier
private Set<Integer> aSet;

It works with the following binding:

bind(Collections.EMPTY_SET).to(Set.class).qualifiedBy(new SomeQualifierLiteral());

ONLY when the field is without the generic, e.g. private Set aSet;

How can I make a successful bind if a generic is present on the field definition?


Solution

  • answered by @PaulSamsotha in his comment.