DefaultWorldpayOrderNotificationHandler implements WorldpayOrderNotificationHandler { @Override public void setDefectiveModification(final WorldpayOrderModificationModel orderModificationModel, final Exception exception, final boolean processed) { orderModificationModel.setDefective(Boolean.TRUE); orderModificationModel.setProcessed(processed); modelService.save(orderModificationModel); if (exception != null) { LOG.error(format("There was an error processing message [{0}]. Reason: [{1}]", orderModificationModel.getPk(), exception.getMessage()), exception); } }  @Override void setDefectiveModification(final WorldpayOrderModificationModel orderModificationModel, final Exception exception, final boolean processed); @Override void setDefectiveReason(final WorldpayOrderModificationModel orderModificationModel, DefectiveReason defectiveReason); @Override void setNonDefectiveAndProcessed(final WorldpayOrderModificationModel modification); @Required void setModelService(final ModelService modelService); @Required void setOrderModificationDao(final OrderModificationDao orderModificationDao);  }
@Test public void setDefectiveModification() { testObj.setDefectiveModification(orderModificationModelMock, exceptionMock, true); verify(orderModificationModelMock).setDefective(Boolean.TRUE); verify(orderModificationModelMock).setProcessed(true); verify(modelServiceMock).save(orderModificationModelMock); }