Testing in Gradle
-
how does that work? -
impement tests into project
Testprinzip F.I.R.S.T
- fast,
- isolated from other tests,
- repeatable,
- self-validating was test successful? (junit does that for us),
- timely write test when code is implemented
Mockito
- simulate objects (fake for tests) important for our projec
when(expected…).thenReturn(…);
What should be tested
- Fehlerfall
- Randbedinungen
- Happypath
—> 70% code coverage
Tests which we have to use
- Junit tests
- integration tests —> create instance of testobject in test and check it