@Test public void executeNestedWithSpecifiedBatchId() throws Exception { String existingBatchId = "a-b-c-d"; when(executionContext.getProperty(DefaultBatchOperationExecutor.CONTEXT_PROPERTY)).thenReturn(existingBatchId); String specifiedBatchId = "d-c-b-a"; BatchOperation operation = mock(BatchOperation.class); mocker.getComponentUnderTest().execute(operation, specifiedBatchId); verify(executionContext, never()).setProperty(eq(DefaultBatchOperationExecutor.CONTEXT_PROPERTY), any()); verify(operation).execute(); }
@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();  }