### Question:
VFSPipelineExecutorRegistry extends InMemoryPipelineExecutorRegistry { @Override public void register(final PipelineExecutorTrace trace) { checkNotNull("trace", trace); final Path path = buildTracePath(trace.getTaskId()); try { registryHelper.storeEntry(path, trace); } catch (Exception e) { logger.error("Unexpected error was produced during trace marshalling/storing, trace: " + trace, e); throw new RuntimeException("Unexpected error was produced during trace marshalling/storing, trace: " + trace, e); } super.register(trace); } VFSPipelineExecutorRegistry(); @Inject  VFSPipelineExecutorRegistry(final VFSRegistryHelper registryHelper); @PostConstruct void init(); @Override void register(final PipelineExecutorTrace trace); @Override void deregister(final String taskId);  }### Answer:
@Test @Override public void testRegister() { prepareTargetPath(); pipelineExecutorRegistry.register(trace); try { verify(registryHelper, times(1)).storeEntry(traceTargetPath, trace); } catch (Exception e) { fail(e.getMessage()); } PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID); assertEquals(trace, result); }
@Test public void testRegisterWhenMarshallingErrors() throws Exception { prepareTargetPath(); expectedException.expectMessage("Unexpected error was produced during trace marshalling/storing, trace: " + trace); doThrow(new Exception("no matter the message here")) .when(registryHelper) .storeEntry(traceTargetPath, trace); pipelineExecutorRegistry.register(trace); }