我正在尝试模拟一个枚举:
public enum SomeEnum implements BaseEnum{
SOME_VALUE("Description", SomeClass.class);
private Class<? extends IConsignador> integracao;
private String descricao;
TipoIntegracao(String descricao, Class<? extends IConsignador> integracao){
this.descricao = descricao;
this.integracao = integracao;
}
@Override
public String getDescricao() {
return descricao;
}
public Class<? extends IConsignador> getIntegracao() {
return integracao;
}
}
我的模拟:
SomeEnum mock = createMock(SomeEnum.class);
expect(mock.getIntegracao()).andReturn( (Class<? extends IConsignador>) eq(ClassWithOutPublicConstructor.class ) );
replay(mock);
但是日食说:
The method andReturn(Class<capture#1-of ? extends IConsignador>) in the type IExpectationSetters<Class<capture#1-of ? extends IConsignador>> is not applicable for the arguments (Class<capture#2-of ? extends IConsignador>)
他建议演员表,但仍然不接受该值。会是什么?