matheusfm / hands-on-unit-tests

unit tests hands-on with mockito and junit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unit Tests Hands-On Build Status codecov

Test Pyramid

Test Pyramid

Unit Tests Libraries

Fakes are objects that have working implementations, but not same as production one.

Fake

Stub is an object that holds predefined data and uses it to answer calls during tests.

Stub

Mocks are objects that register calls they receive. In test assertion we can verify on Mocks that all expected actions were performed.

Mock

Spies are partial mocks

Requisitos

  • Buscar primeiro no cache
  • Se não existir no cache, buscar no disco
  • Se o serviço de cache estiver indisponível, buscar no disco
  • Salvar primeiro no disco, onde o ID é gerado, e depois no cache
  • Lançar IllegalArgumentException se algum parâmetro for null

About

unit tests hands-on with mockito and junit


Languages

Language:Java 100.0%