Skip to main content

Unit Testing

Learn Unit Testing (Spring MVC Testing, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Unit test : checks one class in isolation, with no Spring context, no server and no database, so it runs in milliseconds. Tools : JUnit 5 to structure the test and Mockito to fake collaborators. Arrange, act, assert : set up the data, call the method, then check the result.

More lessons in Spring MVC Testing