@Test
    void testFindAll() {

        // ResponseEntity<List> response = restTemplate.getForEntity(BASEURI + "/books", List.class);

        // find all books and return List<Book>
        ParameterizedTypeReference<List<Book>> typeRef = new ParameterizedTypeReference<>() {
        };
        ResponseEntity<List<Book>> response = restTemplate.exchange(
                BASEURI + "/books",
                HttpMethod.GET,
                null,
                typeRef
        );

        assertEquals(HttpStatus.OK, response.getStatusCode());
        assertEquals(4, response.getBody().size());

    }
Testing with TestRestTemplate and @Testcontainers (image mysql:8.0-debian)
spring-data-jpa-mysql/src/test/java/com/mkyong/BookControllerTest.java