From the course: Spring Cloud GCP: Setting Up a Cloud SQL Database

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Integration testing: In memory

Integration testing: In memory

From the course: Spring Cloud GCP: Setting Up a Cloud SQL Database

Start my 1-month free trial

Integration testing: In memory

- [Lecturer] Integration testing can be resource heavy, which means testing with cloud SQL should be done sparingly to keep down costs. In this video, we are going to discuss how to integration test our application with an in memory database. We have an integration test all ready in the puzzle inventory integration test file. We are testing the Find by Name method. In this test method, we create a puzzle object on lines 32, and 33. We then pass this puzzle to a post request on line 35, using the mock MVC beam. This request will create the Rialto Bridge Puzzle in our database. On line 37, we then make a call to our repository to find a puzzle based on that name. On lines 39, 346, we then use assertions, we first confirm that at least one puzzle was returned from this request. We then retrieve that puzzle from a list and confirm that the names match. Currently, this test will default to using our live Cloud SQL…

Contents