Mocks are objects that register calls they receive. In test assertion we can verify on Mocks that all expected actions were performed.
- 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 fornull