diff --git a/README.md b/README.md index 761fbe1a2..7dd42e261 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,10 @@ The following table list all sample codes related to the spring boot integration | [Rabbit Mq Implementation](./boot-rabbitmq-thymeleaf) | The application, demonstrates how rabbitmq works with producer side acknowledgement | Completed | | [Spring Batch Implementation](./batch-boot-jpa-sample) | The application, demonstrates implementing Spring Batch 5 using simple config and creating batch tables using liquibase | Completed | | [Rest API Documentation with examples](./boot-rest-docs-sample) | This application, demonstrates ability to generate pdf API documentation using spring rest docs | Completed | -| [Custom SequenceNumber and LazyConnectionDataSourceProxy for db connection improvement](./jpa/boot-data-customsequence) | This application demonstrates: - - Custom sequence generation - - Database connection optimization using datasource-proxy and LazyConnectionDataSourceProxy with MariaDB - - SQL query validation using SQLStatementCountValidator - - Dynamic validation using ValidationGroups | Completed | +| [Custom SequenceNumber and LazyConnectionDataSourceProxy for db connection improvement](./jpa/boot-data-customsequence) | This application demonstrates, Custom sequence generation, + Database connection optimization using datasource-proxy and LazyConnectionDataSourceProxy with MariaDB, + SQL query validation using SQLStatementCountValidator, + Dynamic validation using ValidationGroups | Completed | | [KeySet pagination and dynamic search](./jpa/keyset-pagination/blaze-persistence) | Implements KeySet Pagination using Blaze Persistence and enable dynamic search using specifications | Completed | For More info about this repository, Please visit [here](https://rajadilipkolli.github.io/my-spring-boot-experiments/) diff --git a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java index 090e5e9ba..875efbd10 100644 --- a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java +++ b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java @@ -186,6 +186,19 @@ void shouldReturn400WhenUpdatingOrderWithInvalidCustomerId() throws Exception { .hasStatus(HttpStatus.NOT_FOUND); } + @Test + void shouldReturn404WhenUpdatingNonExistentOrder() throws Exception { + OrderRequest orderRequest = new OrderRequest("Updated Order", customer.getId()); + + this.mockMvcTester + .put() + .uri("/api/orders/{id}", "NON_EXISTENT_ID") + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(orderRequest)) + .assertThat() + .hasStatus(HttpStatus.NOT_FOUND); + } + @Test void shouldDeleteOrder() { Order order = orderList.getFirst();