Skip to content

Commit

Permalink
AAE-31637 fix in error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-piotrowiak committed Feb 13, 2025
1 parent 82de2ec commit 2ca7263
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,12 @@ public EntityModel<ActivitiErrorMessage> handleAppException(

@ExceptionHandler({ ConversionFailedException.class })
@ResponseStatus(HttpStatus.BAD_REQUEST)
public EntityModel<ActivitiErrorMessage> handleAppException(
ConversionFailedException ex,
HttpServletResponse response
) {
public ActivitiErrorMessage handleAppException(ConversionFailedException ex, HttpServletResponse response) {
LOGGER.error(ex.getMessage(), ex);
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
return EntityModel.of(
new ActivitiErrorMessageImpl(
HttpStatus.BAD_REQUEST.value(),
ErrorAttributesMessageSanitizer.ERROR_NOT_DISCLOSED_MESSAGE
)
return new ActivitiErrorMessageImpl(
HttpStatus.BAD_REQUEST.value(),
ErrorAttributesMessageSanitizer.ERROR_NOT_DISCLOSED_MESSAGE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.MethodSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.info.BuildProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
Expand All @@ -83,6 +84,7 @@
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.transaction.annotation.Transactional;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
Expand Down Expand Up @@ -133,6 +135,9 @@ public class QueryProcessInstancesEntityIT {
@Autowired
private VariableRepository variableRepository;

@MockitoBean
private BuildProperties buildProperties;

private EventsAggregator eventsAggregator;

private ProcessInstanceEventContainedBuilder processInstanceBuilder;
Expand Down

0 comments on commit 2ca7263

Please sign in to comment.