class: center, middle # Day 3 ### Integration Testing --- ## Testing Review Unit Test * Test the smallest unit of code in isolation --- # TDD & Red, Green, Refactor * Write tests first * Write minimal code to get test to pass * Clean up the code * Get all tests to pass --- ## Unit Tests Are Not Alone -- Integration Tests -- * Testing the integrated parts of a feature -- * All the units and layers combined to make a feature -- * What is being integrated differs for each language, framework, and application purpose --- ## Acceptance Tests -- * Your app is run in an enviroment as close as possible to live enviroment (possibly staging) -- * App is used as end user will. Inputs are filled in, buttons are clicked -- * Tools like selenium are configured on what to click and input -- * Expected behavior is verified by inspecting the output of the app --- ## Integration Tests * It is important to be able to test that all these work together * POJOS * controllers * models * views * database queries --- ## Spring Integration Tests -- * Offer a way to test all the layers WITHOUT... * deploying your code * opening a browser and manually testing -- * The Spring framework provides many utilities * Annotations * Classes * Depedency Injection of test versions of resources (Controllers, Models, Properties...) --- ## Spring Testing Instructor Walkthrough * [https://education.launchcode.org/gis-devops/walkthroughs/spring-integration-tests/#Setup](https://education.launchcode.org/gis-devops/walkthroughs/spring-integration-tests/#Setup)