@Test public void executeWithSpecifiedBatchId() throws Exception { BatchOperation operation = mock(BatchOperation.class); String specifiedBatchId = "a-b-c-d"; mocker.getComponentUnderTest().execute(operation, specifiedBatchId); InOrder inOrder = inOrder(operation, executionContext); inOrder.verify(executionContext, times(1)).setProperty(eq(DefaultBatchOperationExecutor.CONTEXT_PROPERTY), eq(specifiedBatchId)); inOrder.verify(operation).execute(); inOrder.verify(executionContext, times(1)).setProperty(DefaultBatchOperationExecutor.CONTEXT_PROPERTY, null); }
@Override public <E extends Exception> void execute(BatchOperation<E> operation) throws E { String batchId = generateBatchId(); execute(operation, batchId); }
DefaultBatchOperationExecutor implements BatchOperationExecutor { @Override public <E extends Exception> void execute(BatchOperation<E> operation) throws E { String batchId = generateBatchId(); execute(operation, batchId); } }
DefaultBatchOperationExecutor implements BatchOperationExecutor { @Override public <E extends Exception> void execute(BatchOperation<E> operation) throws E { String batchId = generateBatchId(); execute(operation, batchId); }  }
DefaultBatchOperationExecutor implements BatchOperationExecutor { @Override public <E extends Exception> void execute(BatchOperation<E> operation) throws E { String batchId = generateBatchId(); execute(operation, batchId); }  @Override void execute(BatchOperation<E> operation); @Override void execute(BatchOperation<E> operation, String batchId); @Override String getCurrentBatchId(); }
DefaultBatchOperationExecutor implements BatchOperationExecutor { @Override public <E extends Exception> void execute(BatchOperation<E> operation) throws E { String batchId = generateBatchId(); execute(operation, batchId); }  @Override void execute(BatchOperation<E> operation); @Override void execute(BatchOperation<E> operation, String batchId); @Override String getCurrentBatchId();  }