explicitly mock user+role in *IntTest, set global role HOSTMASTER only in dev profile
This commit is contained in:
@ -42,9 +42,6 @@ public class HsadminNgApp {
|
||||
@PostConstruct
|
||||
public void initApplication() {
|
||||
|
||||
// TODO: remove this hack once proper user roles are implemented
|
||||
SecurityUtils.addUserRole(null, null, Role.HOSTMASTER);
|
||||
|
||||
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
|
||||
if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
|
||||
log.error("You have misconfigured your application! It should not run " +
|
||||
@ -54,6 +51,14 @@ public class HsadminNgApp {
|
||||
log.error("You have misconfigured your application! It should not " +
|
||||
"run with both the 'dev' and 'cloud' profiles at the same time.");
|
||||
}
|
||||
|
||||
// TODO: remove this hack once proper user roles are implemented
|
||||
if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
|
||||
// For some strange reasons, HsadminNgApp is created in locally running tests,
|
||||
// but not on Jenkins, therefore the login user had no rights and many tests
|
||||
// failed.
|
||||
SecurityUtils.addUserRole(null, null, Role.HOSTMASTER);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user