JerseyTest:如何绑定到Set

问题描述 投票:1回答:1

使用JerseyTest进行测试时,我无法绑定到:

@Inject
@SomeQualifier
private Set<Integer> aSet;

它适用于以下绑定:

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

仅当该字段没有通用字段时,例如private Set aSet;

如果字段定义中存在泛型,我如何才能成功绑定?

jersey jersey-test-framework
1个回答
0
投票

@PaulSamsotha在评论中回答。

© www.soinside.com 2019 - 2024. All rights reserved.