@Test public void testResolveWithNullParent() throws Exception { assertThat(mocker.getComponentUnderTest().resolve(BLOCK, new Object[] { null }), equalTo(new BlockReference(ENCODED))); verify(dumper).dump(stream, BLOCK); }
@Override public BlockReference resolve(Block block, Object... parameters) { EntityReference parent = null; if (parameters.length > 0 && parameters[0] instanceof EntityReference) { parent = (EntityReference) parameters[0]; } Digest digest = digestFactory.getInstance(); try { dumper.dump(digest.getOutputStream(), block); return new BlockReference(new EntityReference(encoder.encode(digest.digest()), EntityType.BLOCK, parent)); } catch (IOException ignore) { } return null; }
SignedMacroBlockReferenceResolver implements BlockReferenceResolver<Block> { @Override public BlockReference resolve(Block block, Object... parameters) { EntityReference parent = null; if (parameters.length > 0 && parameters[0] instanceof EntityReference) { parent = (EntityReference) parameters[0]; } Digest digest = digestFactory.getInstance(); try { dumper.dump(digest.getOutputStream(), block); return new BlockReference(new EntityReference(encoder.encode(digest.digest()), EntityType.BLOCK, parent)); } catch (IOException ignore) { } return null; } }
SignedMacroBlockReferenceResolver implements BlockReferenceResolver<Block> { @Override public BlockReference resolve(Block block, Object... parameters) { EntityReference parent = null; if (parameters.length > 0 && parameters[0] instanceof EntityReference) { parent = (EntityReference) parameters[0]; } Digest digest = digestFactory.getInstance(); try { dumper.dump(digest.getOutputStream(), block); return new BlockReference(new EntityReference(encoder.encode(digest.digest()), EntityType.BLOCK, parent)); } catch (IOException ignore) { } return null; }  }
SignedMacroBlockReferenceResolver implements BlockReferenceResolver<Block> { @Override public BlockReference resolve(Block block, Object... parameters) { EntityReference parent = null; if (parameters.length > 0 && parameters[0] instanceof EntityReference) { parent = (EntityReference) parameters[0]; } Digest digest = digestFactory.getInstance(); try { dumper.dump(digest.getOutputStream(), block); return new BlockReference(new EntityReference(encoder.encode(digest.digest()), EntityType.BLOCK, parent)); } catch (IOException ignore) { } return null; }  @Override BlockReference resolve(Block block, Object... parameters); }
SignedMacroBlockReferenceResolver implements BlockReferenceResolver<Block> { @Override public BlockReference resolve(Block block, Object... parameters) { EntityReference parent = null; if (parameters.length > 0 && parameters[0] instanceof EntityReference) { parent = (EntityReference) parameters[0]; } Digest digest = digestFactory.getInstance(); try { dumper.dump(digest.getOutputStream(), block); return new BlockReference(new EntityReference(encoder.encode(digest.digest()), EntityType.BLOCK, parent)); } catch (IOException ignore) { } return null; }  @Override BlockReference resolve(Block block, Object... parameters);  }