Fix AmqpMessageDispatcherServiceTest.testSendCancelRequest - set action tenant (#2098)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -66,7 +66,7 @@ public class BaseAmqpService {
|
||||
return ObjectUtils.isEmpty(message.getBody());
|
||||
}
|
||||
|
||||
protected static final void logAndThrowMessageError(final Message message, final String error) {
|
||||
protected static void logAndThrowMessageError(final Message message, final String error) {
|
||||
log.debug("Warning! \"{}\" reported by message: {}", error, message);
|
||||
throw new AmqpRejectAndDontRequeueException(error);
|
||||
}
|
||||
|
||||
@@ -90,4 +90,4 @@ public class DelayedRequeueExceptionStrategy extends ConditionalRejectingErrorHa
|
||||
cause instanceof MessageConversionException ||
|
||||
cause instanceof MessageHandlingException;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,8 +27,7 @@ public class MessageConversionExceptionHandler extends AbstractAmqpErrorHandler<
|
||||
@Override
|
||||
public String getErrorMessage(Throwable throwable) {
|
||||
final String errorMessage = super.getErrorMessage(throwable);
|
||||
//since the detailed error message lies in the first parent of current throwable we retrieve it
|
||||
// and append it to the errorMessage
|
||||
// since the detailed error message lies in the first parent of current throwable we retrieve it and append it to the errorMessage
|
||||
final Optional<String> detailedErrorMessage = getFirstAncestralErrorMessage(throwable.getCause());
|
||||
return detailedErrorMessage.isPresent() ? (detailedErrorMessage.get() + errorMessage) : errorMessage;
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
void testSendCancelRequest() {
|
||||
final Action action = mock(Action.class);
|
||||
when(action.getId()).thenReturn(1L);
|
||||
when(action.getTenant()).thenReturn(TENANT);
|
||||
when(action.getTarget()).thenReturn(testTarget);
|
||||
final CancelTargetAssignmentEvent cancelTargetAssignmentDistributionSetEvent = new CancelTargetAssignmentEvent(
|
||||
action, serviceMatcher.getBusId());
|
||||
|
||||
Reference in New Issue
Block a user