Can someone tell me if this is the correct way to check the current environment when using JHipster ?
public DwollaService(ApplicationProperties applicationProperties, Environment env) throws Exception {
this.dwolla = applicationProperties.dwolla;
this.env = env;
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
Boolean isProd = activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
this.dwollaClient = new Dwolla(
this.dwolla.getKey(),
this.dwolla.getSecret(),
(isProd) ? DwollaEnvironment.PRODUCTION : DwollaEnvironment.SANDBOX
);
}