Application uses Maven as build system, so in order to generate the executable JAR file you only need to execute:
$ mvn package
The executable file can be found at [...]/target/test-web-application.jar
.
Built JAR requires its Maven dependencies to appear in classpath.
In order to ease the run command, please update the pom.xml
file by setting the absolute path to the Maven repository in setting classpathPrefix
inside maven-jar-plugin
configuration block.
Example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>/Users/juan/.m2/repository/</classpathPrefix>
<classpathLayoutType>repository</classpathLayoutType>
<mainClass>org.company.techtest.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
You can run the server with the following command:
$ java -jar test-web-application.jar
Server will start listening on port 8080
. Example http://localhost:8080.
Description of available endpoints, both REST API and web site, can be found in src/docs folder, via:
api.raml
: RAML specification.api.html
: HTML export of the RAML specification.
Initially, there's only one user in database:
- ID:
1
- Username:
user1
- Password:
user1
- Roles:
ADMIN
Use this user's credentials to create new users using the REST API with any (or all) of the following roles:
PAGE_1
PAGE_2
PAGE_3
The repo does not contain unit test files. But you can test all endpoints with the given Postman collection.
In order to run Maven integrated tests, run the following command:
$ mvn clean verify
All tests will run and tests reports will be generated in target
folder:
- Surefire
- Failsafe
- JaCoCo: both unit and integration tests