From the course: Spring Cloud GCP: Setting Up a Cloud SQL Database
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Integration testing: In Cloud SQL
From the course: Spring Cloud GCP: Setting Up a Cloud SQL Database
Integration testing: In Cloud SQL
- [Instructor] Integration testing allows us to test multiple components of our PuzzleInventory app together. It might be useful to integration test our app with the Cloud SQL instance, where it is most beneficial to hit your actual database. We might want to do this to better emulate production. In this video, we are going to test our app's integration with our repository or database using the findByName method. Our PuzzleRepository interface extends the CrudRepository interface, allowing us access to basic methods and interacting with our database. We can use this save method to create a new object or a findByID method to retrieve an object by its ID. We can also create more specific or complicated methods in our repository. Such methods might benefit from integration testing over unit testing. In this case, I have a findByName method that will take in the name of a puzzle I am looking for. JPA or the Java Persistence…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.