use of org.xwiki.crypto.DigestFactory in project xwiki-platform by xwiki.
the class SignedMacroBlockReferenceResolverTest method setUp.
@Before
public void setUp() throws Exception {
DigestFactory digestFactory = mocker.getInstance(DigestFactory.class, "SHA-1");
BinaryStringEncoder encoder = mocker.getInstance(BinaryStringEncoder.class, "Base64");
dumper = mocker.getInstance(BlockDumper.class, "macro");
Digest digest = mock(Digest.class);
stream = new ByteArrayOutputStream();
when(digest.getOutputStream()).thenReturn(stream);
when(digest.digest()).thenReturn(DIGEST_BLOCK);
when(digestFactory.getInstance()).thenReturn(digest);
when(encoder.encode(DIGEST_BLOCK)).thenReturn(ENCODED);
}
Aggregations