@Test @RunWithCustomExecutor public void logErrorWithDetails() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); ArgumentCaptor<LogbookOperationParameters> captor = ArgumentCaptor.forClass(LogbookOperationParameters.class); AgenciesManager manager = new AgenciesManager(logbookOperationsClient, newOperationLogbookGUID(0)); manager.logError("ErorMessage", "DELETION"); verify(logbookOperationsClient).update(captor.capture()); LogbookOperationParameters log = captor.getValue(); assertThat(log.getParameterValue(eventType)).isEqualTo(AGENCIES_IMPORT_EVENT); assertThat(log.getParameterValue(eventTypeProcess)).isEqualTo("MASTERDATA"); assertThat(log.getParameterValue(outcome)).isEqualTo("KO"); assertThat(log.getParameterValue(outcomeDetail)).isEqualTo(AGENCIES_IMPORT_EVENT + ".DELETION.KO"); }
public void logError(String errorsDetails, String subEvenType) throws VitamException { LOGGER.error("There validation errors on the input file {}", errorsDetails); final LogbookOperationParameters logbookParameters = LogbookParameterHelper .newLogbookOperationParameters(eip, AGENCIES_IMPORT_EVENT, eip, LogbookTypeProcess.MASTERDATA, StatusCode.KO, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, StatusCode.KO), eip); if (subEvenType != null) { logbookParameters.putParameterValue(LogbookParameterName.outcomeDetailMessage, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); logbookParameters.putParameterValue(LogbookParameterName.outcomeDetail, VitamLogbookMessages.getOutcomeDetail(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); } logbookMessageError(errorsDetails, logbookParameters); logbookClient.update(logbookParameters); }
AgenciesManager { public void logError(String errorsDetails, String subEvenType) throws VitamException { LOGGER.error("There validation errors on the input file {}", errorsDetails); final LogbookOperationParameters logbookParameters = LogbookParameterHelper .newLogbookOperationParameters(eip, AGENCIES_IMPORT_EVENT, eip, LogbookTypeProcess.MASTERDATA, StatusCode.KO, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, StatusCode.KO), eip); if (subEvenType != null) { logbookParameters.putParameterValue(LogbookParameterName.outcomeDetailMessage, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); logbookParameters.putParameterValue(LogbookParameterName.outcomeDetail, VitamLogbookMessages.getOutcomeDetail(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); } logbookMessageError(errorsDetails, logbookParameters); logbookClient.update(logbookParameters); } }
AgenciesManager { public void logError(String errorsDetails, String subEvenType) throws VitamException { LOGGER.error("There validation errors on the input file {}", errorsDetails); final LogbookOperationParameters logbookParameters = LogbookParameterHelper .newLogbookOperationParameters(eip, AGENCIES_IMPORT_EVENT, eip, LogbookTypeProcess.MASTERDATA, StatusCode.KO, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, StatusCode.KO), eip); if (subEvenType != null) { logbookParameters.putParameterValue(LogbookParameterName.outcomeDetailMessage, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); logbookParameters.putParameterValue(LogbookParameterName.outcomeDetail, VitamLogbookMessages.getOutcomeDetail(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); } logbookMessageError(errorsDetails, logbookParameters); logbookClient.update(logbookParameters); } AgenciesManager(LogbookOperationsClient logbookClient, GUID eip); @VisibleForTesting  AgenciesManager(LogbookOperationsClient logBookclient, GUID eip, boolean warning); }
AgenciesManager { public void logError(String errorsDetails, String subEvenType) throws VitamException { LOGGER.error("There validation errors on the input file {}", errorsDetails); final LogbookOperationParameters logbookParameters = LogbookParameterHelper .newLogbookOperationParameters(eip, AGENCIES_IMPORT_EVENT, eip, LogbookTypeProcess.MASTERDATA, StatusCode.KO, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, StatusCode.KO), eip); if (subEvenType != null) { logbookParameters.putParameterValue(LogbookParameterName.outcomeDetailMessage, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); logbookParameters.putParameterValue(LogbookParameterName.outcomeDetail, VitamLogbookMessages.getOutcomeDetail(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); } logbookMessageError(errorsDetails, logbookParameters); logbookClient.update(logbookParameters); } AgenciesManager(LogbookOperationsClient logbookClient, GUID eip); @VisibleForTesting  AgenciesManager(LogbookOperationsClient logBookclient, GUID eip, boolean warning); void logStarted(String eventType); void logFinish(String fileName); void logEventSuccess(String eventType); void logEventWarning(String eventType); void logError(String errorsDetails, String subEvenType); void setEvDetData(ObjectNode evDetData); }
AgenciesManager { public void logError(String errorsDetails, String subEvenType) throws VitamException { LOGGER.error("There validation errors on the input file {}", errorsDetails); final LogbookOperationParameters logbookParameters = LogbookParameterHelper .newLogbookOperationParameters(eip, AGENCIES_IMPORT_EVENT, eip, LogbookTypeProcess.MASTERDATA, StatusCode.KO, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, StatusCode.KO), eip); if (subEvenType != null) { logbookParameters.putParameterValue(LogbookParameterName.outcomeDetailMessage, VitamLogbookMessages.getCodeOp(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); logbookParameters.putParameterValue(LogbookParameterName.outcomeDetail, VitamLogbookMessages.getOutcomeDetail(AGENCIES_IMPORT_EVENT, subEvenType, StatusCode.KO)); } logbookMessageError(errorsDetails, logbookParameters); logbookClient.update(logbookParameters); } AgenciesManager(LogbookOperationsClient logbookClient, GUID eip); @VisibleForTesting  AgenciesManager(LogbookOperationsClient logBookclient, GUID eip, boolean warning); void logStarted(String eventType); void logFinish(String fileName); void logEventSuccess(String eventType); void logEventWarning(String eventType); void logError(String errorsDetails, String subEvenType); void setEvDetData(ObjectNode evDetData); static final VitamLogger LOGGER; }