Skip to content

Seabath/TestSparkAPI

Repository files navigation

TestSparkAPI

This project is an API that record tests launched by any system.

Here is a trello link to follow what's to come: Trello

Technologies

The API is written in JAVA 8.
The library used here to map routes is Spark java
The database management system used here is Postgresql, but any can be added if needed.
To communicate with the database, the library used is hibernate with its dialect PostgreSQL95Dialect. For more details about hibernate configuration see here.

To build the API and run unit tests, you have to use maven.

Usage

To use this API, you can build the dockerfile and run the image on your favorite server.

According to this file, you can see that database url, user and password must be defined as environment variables. So when running your image, don't forget to put those credentials in your container. You can see here an example of how to use it with docker-compose.

Unit Tests

To mock tests, mockito it overly used. The goal here is to have 1 test class for 1 source class.

Pojo and entity are not tested because there is no logic inside. DAOs are not tested either, it's an issue I have to address later.
But as every methods there are calls of single hibernate function, there shouldn't be a problem short term speaking. And according to getSessionFactorymethod, if a problem must occur, it will be at API launch, i-e. easy to track and fix.

To record test coverage, I use jacoco; mvn jacoco:report.

Mutation testing is performed by pitest; mvn org.pitest:pitest-maven:mutationCoverage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •