According to https://stackoverflow.com/a/33042872/4106030
we should not use @Profile to let a spring profile decide whether all tests in a test class shall be executed or ignored.
There is stated:
@Profileis used to selectively enable a component (e.g.,@Service, etc.),@Configurationclass, or@Beanmethod if one of the named bean definition profiles is active in the Spring Environment for the ApplicationContext. This annotation is not directly related to testing:@Profileshould not be used on a test class.
Is this true? If yes then why?