use of org.xwiki.rendering.signature.BlockSignatureVerifier in project xwiki-platform by xwiki.
the class SignableMacroTest method setUp.
@Before
public void setUp() throws Exception {
BeanManager beanManager = mocker.getInstance(BeanManager.class);
when(beanManager.getBeanDescriptor(Object.class)).thenReturn(new DefaultBeanDescriptor(Object.class));
store = mocker.registerMockComponent(SignatureStore.class);
when(store.retrieve(BLOCK_REFERENCE)).thenReturn(SIGNATURE);
BlockSignatureGenerator signer = mocker.registerMockComponent(BlockSignatureGenerator.class, "macro");
when(signer.generate(BLOCK, PARAMETERS)).thenReturn(SIGNATURE);
BlockSignatureVerifier verifier = mocker.registerMockComponent(BlockSignatureVerifier.class, "macro");
when(verifier.verify(SIGNATURE, BLOCK, null)).thenReturn(VERIFIED);
BlockReferenceResolver<Block> resolver = mocker.registerMockComponent(new DefaultParameterizedType(null, BlockReferenceResolver.class, Block.class), "currentsignedmacro");
when(resolver.resolve(BLOCK)).thenReturn(BLOCK_REFERENCE);
macro = mocker.getComponentUnderTest();
}
Aggregations