if (Environment.current == Environment.TEST)

I am trying to upgrade Grails 2.4 to 3.3.6 and not able to change environments: from Development to test, Can someone help me?

2

There are 2 best solutions below

0
On BEST ANSWER

You can pass the environment when your start the application.

grails -Dgrails.env=TEST run-app

Check this

0
On

I was doing only copy and paste my controllers and services so there is no run configuration was created by default. I just go to IntelliJ--Run--Edit configuration and added the information as per the screenshot.enter image description here