Requirements
1. Java JDK
2. Intellij
3. Git
Step-by-step guide
Install Java JDK
The OpenJDK 11 can be found at SR\Java\openjdk-11+28_windows-x64_bin.zip. Extract the
ZIP archive to C:\dev. Now we need to make that Java version the default one for the
computer. To achieve this we have to add its bin directory to the system's Path variable:
1. Launch Control Panel ⇒ System and Security ⇒ System ⇒ click Advanced system
2. Switch to Advanced tab ⇒ click Environment Variables button.
settings on the left pane.
3. Under System Variables (the bottom pane), click on New... and add a
variable JAVA_HOME with the path to the SDK directory with the value C:\dev\jdk-
4. Then select variable Path ⇒ click Edit...
11
5. Add the following text in front of the existing value
%JAVA_HOME%\bin;
6. Click OK button until everything is closed.
7. Check by typing
java -version
8.
into a command shell which should print out something similar to
9. openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
10.
Install IntelliJ
The installer for IntelliJ Ultimate can be found at SR\IntelliJ\[Link]. During
installation process you are asked some questions. Just use the default values. Optionally you
can associate Java files with IntelliJ by activating the corresponding checkbox.
To access the marketplace for IntelliJ plugins we need to set the HTTP proxy settings. Under
configuration there is a section Plugins. In the window for plugins on the upper right there is a
cog wheel icon where you find the configuration for proxy settings.
In the dialogue you have to select the option to auto-detect settings and add the configuration
URL [Link] This should allow IntelliJ to
access needed information and the marketplace page should begin to fill with available
plugins.
Install git
The installer for Windows can be found at SR\Git\Git-[Link]-[Link]. During installation,
you will be asked some questions but you can just use the defaults.
After finishing the git installation you can start Git Bash which opens a terminal window.
Now we need to create a personal SSH key. At the command prompt type the command:
ssh-keygen
Just repeatedly hit the return key every time the command waits for input to use the default
values. At the end of execution it will report back where it has put your public key. This looks
like:
Your public key has been saved in /c/Users/cs0000/.ssh/id_rsa.pub.
Now we need the contents of that file so you can just type another command (replace the path
with your value):
less /c/Users/cs0000/.ssh/id_rsa.pub
Copy the lines into your clipboard and open up the Bitbucket server in a web browser. After
having logged in open your account settings. There you should see a section SSH keys. Here
you need to add a key and paste the contents of your id_rsa.pub file we copied to clipboard
before. Having added the key you will be presented with an SSH URL for cloning repositories
on the Bitbucket project pages. Use this URL instead of the HTTP(S) variant to clone
repositories to avoid any certificate errors / problems.
SET UP Test Project
STASH / Bitbucket : [Link]
browse
Clone Project using SSH : ssh://git@[Link]/onekyc/[Link]
Or
Clone project using HTTP: git clone
[Link]
How to Import the Gradle Project
1. If no project is currently opened in IntelliJ IDEA, click Open on the welcome
screen. Otherwise, select File -> Open from the main menu.
2. In the dialogue that opens, select the project you downloaded from the git
3. Select a file that contains a Gradle project description [Link]. Click OK.
4. In the dialogue that opens, click Open as Project. IntelliJ IDEA opens and
syncs the project in the IDE.
Note: If you have the offline mode enabled in your project, the opening or re-
importing of the project might fail. To fix the issue, disable the offline mode
and re-import your project.
Access the Gradle settings
Use the Gradle settings to configure the build and run actions for each linked
Gradle project, a Gradle version, importing of the project's changes, and so
on.
1. In the Settings/Preferences dialog Ctrl+Alt+S , go to Build, Execution,
Deployment| Gradle.
Use the default Gradle wrapper, use a Gradle wrapper as a task.
In the Use Gradle from list select the option: '[Link]'
file: this is a recommended default option that uses Gradle wrapper.
In this case you delegate the update of Gradle versions to Gradle and get an
automatic Gradle download for the build. This option also lets you build with a
precise Gradle version. The Gradle version is saved in the gradle-
[Link] file in the gradle directory of the project and helps you
eliminate any Gradle version problems.
Download Gradle using wrapper
Using the Wrapper looks almost exactly like running the build with a Gradle
installation. Depending on the operating system you either
run gradlew or [Link] instead of the gradle command.
The following console output demonstrate the use of the Wrapper on a
Windows machine for a Java-based project.
The following console output demonstrate the use of the Wrapper on a Windows machine for
a Java-based project.
Example:
Executing the build with the Wrapper batch file
$ [Link] build
Downloading [Link]
[Link]
...............................................................
......................
Unzipping C:\Documents and Settings\Claudia\.gradle\wrapper\
dists\gradle-5.0-all\ac27o8rbd0ic8ih41or9l32mv\gradle-5.0-
[Link] to C:\Documents and Settings\Claudia\.gradle\wrapper\
dists\gradle-5.0-al\ac27o8rbd0ic8ih41or9l32mv
Set executable permissions for: C:\Documents and Settings\
Claudia\.gradle\wrapper\dists\gradle-5.0-all\
ac27o8rbd0ic8ih41or9l32mv\gradle-5.0\bin\gradle
BUILD SUCCESSFUL in 12s
1 actionable task: 1 executed
Test Execution
Test Execution commands
DEV environment
Windows CMD Prompt
gradlew clean test "-[Link]=--tags {‘@tagname’}" -Denv=dev -DdbUser={username} -DdbPwd={password}
Eg: ./gradlew clean test "-[Link]=--tags @nrdd" -Denv=dev -DdbUser=dbusername -DdbPwd=password123!
Other OS (or git bash)
./gradlew clean test "-[Link]=--tags {‘tagname’}" -Denv=dev -DdbUser={username} -DdbPwd={password}
Eg: ./gradlew clean test "-[Link]=--tags @nrdd" -Denv=dev -DdbUser=dbusername -DdbPwd=password123\!
Note: Please use escape character, if you have any special characters in your password
or username (not for Windows users)
Create run configuration for Debugging
1. Select Run | Edit Configurations Shift+Alt+F10 .
The Run/Debug Configurations dialog opens.
2. In the Run/Debug Configurations dialog, click and select Gradle to add
a new configuration.
3. On the right side of the Run/Debug Configurations dialog, in the Name field,
enter the name of your configuration: For Example Test_DEV for the dev
environment.
o Gradle project - click and select the registered Gradle project.
o Tasks – type in ‘clean test’
o VM options - you can customize VM options by typing in
"-[Link]=--tags {‘tagname’}" -Denv=dev -DdbUser={username} -DdbPwd={password}
4. Click OK.
The created configuration is added to the Run Configurations node in
the Gradle Projects tool window. You can create the run configuration for
several tasks.
5. Double-click the configuration to run the task or right-click the configuration
and select Debug for debugging.
6.