dimanche 28 mai 2017

Autowired implementation based on profile Spring Boot

I am developing a REST API with Spring Boot.The problem it's that I have one interface and two implementations and I want to test only with the mock implementation.

Interface CRMService 

@Service
CRMServiceImpl

@Service
CRMServiceMock

Implementations: the first one is the real integration with the backend and de second is a mock for testing purposes, what's the best approach? Integration test or test based on the active profile ? If I need to autowire a service based on profile what's the best practice?

Aucun commentaire:

Enregistrer un commentaire