logic or ways to check if code logic performs as expected

Two Main Types:

![[Pasted image 20260113125505.png]]

Perform testing

Testing Scenarios

Mockito is used to mock interface so that dummy functionality can be added to mock interface that can be used in unit testing

Mockito - Basic Annotations

Stubbing: Configure the mock and define what to do when specific methods of the mock are called

when(xxx.method()).thenReturn()
doReturn().when(xxx).method()
when().thenCallRealMethod()
when().thenThrow()

Verify

Testing in Repository