@Test(expected = PermanentException.class) public void testSendStatusUpdateErrorIdNull() throws Exception { when(statusUpdateForCareClient.certificateStatusUpdateForCare(anyString(), any(CertificateStatusUpdateForCareType.class))) .thenReturn(buildResponse(ResultCodeType.ERROR, null, "error text")); sendStatusUpdate(createRequest()); }
public void sendStatusUpdate(CertificateStatusUpdateForCareType request, @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress, @Header(NotificationRouteHeaders.USER_ID) String userId, @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId, @Header(Constants.JMS_TIMESTAMP) long messageTimestamp) throws TemporaryException, DiscardCandidateException, PermanentException { if (Objects.nonNull(userId)) { LOG.debug("Set hanteratAv to '{}'", userId); request.setHanteratAv(hsaId(userId)); } final MessageContext mc = MessageContext.of(request, logicalAddress, correlationId); if (isFilterOutdatedMessagesFeatureActive() && messageRedeliveryFlag.isOutdated(mc.key(), messageTimestamp)) { LOG.info("WSClient outdated status update for {} is silently dropped", mc); return; } try { final ResultType result = exchange(mc); switch (result.getResultCode()) { case ERROR: handleError(mc, result); break; case INFO: LOG.info("{} message: {}", mc, result.getResultText()); break; case OK: break; } if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.lowerError(mc.key(), messageTimestamp); } } catch (TemporaryException e) { if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.raiseError(mc.key()); } throw e; } }
NotificationWSClient { public void sendStatusUpdate(CertificateStatusUpdateForCareType request, @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress, @Header(NotificationRouteHeaders.USER_ID) String userId, @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId, @Header(Constants.JMS_TIMESTAMP) long messageTimestamp) throws TemporaryException, DiscardCandidateException, PermanentException { if (Objects.nonNull(userId)) { LOG.debug("Set hanteratAv to '{}'", userId); request.setHanteratAv(hsaId(userId)); } final MessageContext mc = MessageContext.of(request, logicalAddress, correlationId); if (isFilterOutdatedMessagesFeatureActive() && messageRedeliveryFlag.isOutdated(mc.key(), messageTimestamp)) { LOG.info("WSClient outdated status update for {} is silently dropped", mc); return; } try { final ResultType result = exchange(mc); switch (result.getResultCode()) { case ERROR: handleError(mc, result); break; case INFO: LOG.info("{} message: {}", mc, result.getResultText()); break; case OK: break; } if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.lowerError(mc.key(), messageTimestamp); } } catch (TemporaryException e) { if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.raiseError(mc.key()); } throw e; } } }
NotificationWSClient { public void sendStatusUpdate(CertificateStatusUpdateForCareType request, @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress, @Header(NotificationRouteHeaders.USER_ID) String userId, @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId, @Header(Constants.JMS_TIMESTAMP) long messageTimestamp) throws TemporaryException, DiscardCandidateException, PermanentException { if (Objects.nonNull(userId)) { LOG.debug("Set hanteratAv to '{}'", userId); request.setHanteratAv(hsaId(userId)); } final MessageContext mc = MessageContext.of(request, logicalAddress, correlationId); if (isFilterOutdatedMessagesFeatureActive() && messageRedeliveryFlag.isOutdated(mc.key(), messageTimestamp)) { LOG.info("WSClient outdated status update for {} is silently dropped", mc); return; } try { final ResultType result = exchange(mc); switch (result.getResultCode()) { case ERROR: handleError(mc, result); break; case INFO: LOG.info("{} message: {}", mc, result.getResultText()); break; case OK: break; } if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.lowerError(mc.key(), messageTimestamp); } } catch (TemporaryException e) { if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.raiseError(mc.key()); } throw e; } }  }
NotificationWSClient { public void sendStatusUpdate(CertificateStatusUpdateForCareType request, @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress, @Header(NotificationRouteHeaders.USER_ID) String userId, @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId, @Header(Constants.JMS_TIMESTAMP) long messageTimestamp) throws TemporaryException, DiscardCandidateException, PermanentException { if (Objects.nonNull(userId)) { LOG.debug("Set hanteratAv to '{}'", userId); request.setHanteratAv(hsaId(userId)); } final MessageContext mc = MessageContext.of(request, logicalAddress, correlationId); if (isFilterOutdatedMessagesFeatureActive() && messageRedeliveryFlag.isOutdated(mc.key(), messageTimestamp)) { LOG.info("WSClient outdated status update for {} is silently dropped", mc); return; } try { final ResultType result = exchange(mc); switch (result.getResultCode()) { case ERROR: handleError(mc, result); break; case INFO: LOG.info("{} message: {}", mc, result.getResultText()); break; case OK: break; } if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.lowerError(mc.key(), messageTimestamp); } } catch (TemporaryException e) { if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.raiseError(mc.key()); } throw e; } }  void sendStatusUpdate(CertificateStatusUpdateForCareType request,
        @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress,
        @Header(NotificationRouteHeaders.USER_ID) String userId,
        @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId,
        @Header(Constants.JMS_TIMESTAMP) long messageTimestamp); }
NotificationWSClient { public void sendStatusUpdate(CertificateStatusUpdateForCareType request, @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress, @Header(NotificationRouteHeaders.USER_ID) String userId, @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId, @Header(Constants.JMS_TIMESTAMP) long messageTimestamp) throws TemporaryException, DiscardCandidateException, PermanentException { if (Objects.nonNull(userId)) { LOG.debug("Set hanteratAv to '{}'", userId); request.setHanteratAv(hsaId(userId)); } final MessageContext mc = MessageContext.of(request, logicalAddress, correlationId); if (isFilterOutdatedMessagesFeatureActive() && messageRedeliveryFlag.isOutdated(mc.key(), messageTimestamp)) { LOG.info("WSClient outdated status update for {} is silently dropped", mc); return; } try { final ResultType result = exchange(mc); switch (result.getResultCode()) { case ERROR: handleError(mc, result); break; case INFO: LOG.info("{} message: {}", mc, result.getResultText()); break; case OK: break; } if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.lowerError(mc.key(), messageTimestamp); } } catch (TemporaryException e) { if (isFilterOutdatedMessagesFeatureActive()) { messageRedeliveryFlag.raiseError(mc.key()); } throw e; } }  void sendStatusUpdate(CertificateStatusUpdateForCareType request,
        @Header(NotificationRouteHeaders.LOGISK_ADRESS) String logicalAddress,
        @Header(NotificationRouteHeaders.USER_ID) String userId,
        @Header(NotificationRouteHeaders.CORRELATION_ID) String correlationId,
        @Header(Constants.JMS_TIMESTAMP) long messageTimestamp);  }