@Test
    void testFindByPublishedDateAfter() {

        String date = "2023-07-01";
        ParameterizedTypeReference<List<Book>> typeRef = new ParameterizedTypeReference<>() {
        };

        // find Book C
        ResponseEntity<List<Book>> response = restTemplate.exchange(
                BASEURI + "/books/find/date-after/" + date,
                HttpMethod.GET,
                null,
                typeRef
        );

        assertEquals(HttpStatus.OK, response.getStatusCode());

        // test list of objects
        List<Book> result = response.getBody();
        assert result != null;

        assertEquals(2, result.size());

        assertThat(result).extracting(Book::getTitle)
                .containsExactlyInAnyOrder(
                        "Book A", "Book B");
        assertThat(result).extracting(Book::getPrice)
                .containsExactlyInAnyOrder(
                        new BigDecimal("9.99"), new BigDecimal("19.99"));
        assertThat(result).extracting(Book::getPublishDate)
                .containsExactlyInAnyOrder
                        (LocalDate.parse("2023-08-31"), LocalDate.parse("2023-07-31"));
    }
Testing with TestRestTemplate and @Testcontainers (image mysql:8.0-debian)
spring-data-jpa-mysql/src/test/java/com/mkyong/BookControllerTest.java