Refined unit and integration tests