@Test void testResolvesToFalseWithBatchingUnitOfWorkIfMessageIsLast() { List<? extends EventMessage<?>> events = createEvents(5); new BatchingUnitOfWork<>(events).execute(() -> assertTrue(subject.resolveParameterValue(events.get(4)))); }
@Override public Boolean resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(unitOfWork -> !(unitOfWork instanceof BatchingUnitOfWork<?>) || ((BatchingUnitOfWork<?>) unitOfWork).isLastMessage(message)).orElse(true); }
ConcludesBatchParameterResolverFactory extends AbstractAnnotatedParameterResolverFactory<ConcludesBatch,
        Boolean> implements ParameterResolver<Boolean> { @Override public Boolean resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(unitOfWork -> !(unitOfWork instanceof BatchingUnitOfWork<?>) || ((BatchingUnitOfWork<?>) unitOfWork).isLastMessage(message)).orElse(true); } }
ConcludesBatchParameterResolverFactory extends AbstractAnnotatedParameterResolverFactory<ConcludesBatch,
        Boolean> implements ParameterResolver<Boolean> { @Override public Boolean resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(unitOfWork -> !(unitOfWork instanceof BatchingUnitOfWork<?>) || ((BatchingUnitOfWork<?>) unitOfWork).isLastMessage(message)).orElse(true); } ConcludesBatchParameterResolverFactory(); }
ConcludesBatchParameterResolverFactory extends AbstractAnnotatedParameterResolverFactory<ConcludesBatch,
        Boolean> implements ParameterResolver<Boolean> { @Override public Boolean resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(unitOfWork -> !(unitOfWork instanceof BatchingUnitOfWork<?>) || ((BatchingUnitOfWork<?>) unitOfWork).isLastMessage(message)).orElse(true); } ConcludesBatchParameterResolverFactory(); @Override Boolean resolveParameterValue(Message<?> message); @Override boolean matches(Message<?> message); }
ConcludesBatchParameterResolverFactory extends AbstractAnnotatedParameterResolverFactory<ConcludesBatch,
        Boolean> implements ParameterResolver<Boolean> { @Override public Boolean resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(unitOfWork -> !(unitOfWork instanceof BatchingUnitOfWork<?>) || ((BatchingUnitOfWork<?>) unitOfWork).isLastMessage(message)).orElse(true); } ConcludesBatchParameterResolverFactory(); @Override Boolean resolveParameterValue(Message<?> message); @Override boolean matches(Message<?> message);  }