This README would normally document whatever steps are necessary to get your application up and running.
-
Install PostgreSQL in your local environment (suppose you've already known about how to do this)
-
Login to PostgreSQL and create new database named
hcms
. Leave it empty for now. -
Configuration
- install and configure
JAVA_HOME
path in your local environment.
- install and configure
-
Dependencies
- Gradle 2+
- JDK/JRE 8
-
Execute DDL Scripts (Import database tables)
- You can do this simply just by running command
gradle flywayMigrate -i
from the terminal (console) withinhcms-core
directory.
- You can do this simply just by running command
-
Database configuration
- please adjust the db connection to match your local DB configuration. You can do this by replacing the database property values which can be found in
hrms-api/hrms-rest-api/src/main/resources/application.properties
file.
- please adjust the db connection to match your local DB configuration. You can do this by replacing the database property values which can be found in
-
How to run tests
gradle testClasses
-
Deployment instructions
- run as spring-boot application
- open the terminal/console
cd
tohcms-api
- execute as 'spring-boot' application simply by running
gradle bootRun
- deploy as war
- build the war simply by running the command
gradle clean build
, then deploy that war to preconfigured web container such as tomcat, jetty, or any other web/servlet container.
- build the war simply by running the command
- run as spring-boot application
-
API Uses
Example of Request :
curl -i -H 'Content-Type: application/json' -X POST -d '{"username": "yauritux", "password":"test123"}' http://localhost:8080/api/login
Example of Response :
{ "data": { "status": "LOGGED_IN", "_links": { "self": { "href": "http://localhost:8080/api/login" }, "user_resource": { "href": "http://localhost:8080/api/user/yauri.attamimi" } }, "logged_in_time": 1435735220926, "current_user": "yauritux", "auth_token": "67f9d917a60f713299ebd46de8a09e795ebbbbd4103e9ce89dcde421b14b5dd3a738de626a547fd668822c905d795602e5e161577d946b1d2c5b56955b18728a" }, "apiVersion": "1.0.0" }
Subsequently, you need to provide the
username
and it'sauth_token
in every API call.
There's only one rule to write your unit test. i.e. name of the method should be written in 3 parts, and each part is splitted by underscore character ('_') as shown below:
public void part1_part2_part3()
- part1 represents the name of the method which is under testing
- part2 represents the scenario / test case
- part3 represents the expected result
e.g. : public void findRoleByName_existingName_roleObjectIsReturned()
> <<EMPTY>>
> <<EMPTY>>
- Repo owner or admin : yauritux@gmail.com =======