@Test public void testExecuteJdbcErrorStatement() throws Exception { JdbcExecutionRequest jdbcExecutionRequest = jdbcServiceTestHelper.createDefaultUpdateJdbcExecutionRequest(); jdbcExecutionRequest.getStatements().get(0).setSql(MockJdbcOperations.CASE_2_SQL); List<FieldExtension> fieldExtensionList = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>(); populateParameters(jdbcExecutionRequest, fieldExtensionList, parameters); JdbcExecutionResponse expectedJdbcExecutionResponse = new JdbcExecutionResponse(); expectedJdbcExecutionResponse.setStatements(jdbcExecutionRequest.getStatements()); expectedJdbcExecutionResponse.getStatements().get(0).setStatus(JdbcStatementStatus.ERROR); expectedJdbcExecutionResponse.getStatements().get(0).setErrorMessage("java.sql.SQLException: test DataIntegrityViolationException cause"); String expectedJdbcExecutionResponseString = jsonHelper.objectToJson(expectedJdbcExecutionResponse); Map<String, Object> variableValuesToValidate = new HashMap<>(); variableValuesToValidate.put(BaseJavaDelegate.VARIABLE_JSON_RESPONSE, expectedJdbcExecutionResponseString); variableValuesToValidate.put(ActivitiRuntimeHelper.VARIABLE_ERROR_MESSAGE, "There are failed executions. See JSON response for details."); executeWithoutLogging(ActivitiRuntimeHelper.class, () -> { testActivitiServiceTaskFailure(JAVA_DELEGATE_CLASS_NAME, fieldExtensionList, parameters, variableValuesToValidate); }); }
jdbcStatement.setErrorMessage(maskSensitiveInformation(exception, variables));
jdbcStatement.setErrorMessage(maskSensitiveInformation(exception, variables));
sourceErrorMessage = this.getErrorMessage(); String copyErrorMessage = ((String) strategy.copy(LocatorUtils.property(locator, "errorMessage", sourceErrorMessage), sourceErrorMessage, (this.errorMessage!= null))); copy.setErrorMessage(copyErrorMessage); } else { if (errorMessageShouldBeCopiedAndSet == Boolean.FALSE) {
sourceErrorMessage = this.getErrorMessage(); String copyErrorMessage = ((String) strategy.copy(LocatorUtils.property(locator, "errorMessage", sourceErrorMessage), sourceErrorMessage, (this.errorMessage!= null))); copy.setErrorMessage(copyErrorMessage); } else { if (errorMessageShouldBeCopiedAndSet == Boolean.FALSE) {
sourceErrorMessage = this.getErrorMessage(); String copyErrorMessage = ((String) strategy.copy(LocatorUtils.property(locator, "errorMessage", sourceErrorMessage), sourceErrorMessage, (this.errorMessage!= null))); copy.setErrorMessage(copyErrorMessage); } else { if (errorMessageShouldBeCopiedAndSet == Boolean.FALSE) {