我想测试 authzforce 提供的请求预处理器扩展,并根据我的用例进行更改。但是我很困惑如何测试它并为它创建 junit 测试,其中所需的每个变量都是抽象的并且无法实例化?
原代码提供于:https://github.com/authzforce/core/blob/release-17.1.0/pdp-engine/src/main/java/org/ow2/authzforce/core/pdp/impl /io/SingleDecisionXacmlJaxbRequestPreprocessor.java 我是 java 的新手并且很困惑。
特别是,填写这个代码有意义吗
AttributeValueFactoryRegistry attributeValueFactoryRegistry = new AttributeValueFactoryRegistry() {
@Override
public ConstantExpression<? extends AttributeValue> newExpression(String s, List<Serializable> list, Map<QName, String> map, XPathCompiler xPathCompiler) throws IllegalArgumentException {
return null;
}
@Override
public AttributeValueFactory<?> getCompatibleFactory(Class<? extends Serializable> aClass) {
return null;
}
@Override
public AttributeValue newAttributeValue(Serializable serializable) throws IllegalArgumentException, UnsupportedOperationException {
return null;
}
@Override
public AttributeBag<?> newAttributeBag(Collection<? extends Serializable> collection, AttributeSource attributeSource) throws UnsupportedOperationException, IllegalArgumentException {
return null;
}
@Override
public AttributeBag<?> newAttributeBag(Collection<? extends Serializable> collection) throws UnsupportedOperationException, IllegalArgumentException {
return null;
}
@Override
public AttributeValueFactory<?> getExtension(String s) {
return null;
}
@Override
public Set<AttributeValueFactory<?>> getExtensions() {
return null;
}
};
只是为了创建一个 AttributeValueFactoryRegistry 的变量?