Technical assignment test for be.care, July 2019.
A description of the expected assignment is located here.
This project works on the following operating systems:
- Linux,
- macOS,
- Windows.
This project requires the following item to be installed and configured in your environment:
- Java 8.
-
Clone the repository to your local computer.
git clone https://github.com/alxlve/coding-assignment-becare
-
Enter the project directory.
cd coding-assignment-becare
-
Package the project with Maven.
./mvnw package
-
Run the application.
java -jar target/coding-assignment.becare-<version>.jar
-
Navigate to http://localhost:8080.
You can run the application with one of the following Spring Boot profiles:
debug-dev
,dev
,staging
,prod
.
To select a profile append the parameter -Dspring.profiles.active=<profile-name>
on the java
command line.
The default profile to be selected is dev
if you do not specify any on the command line.
Here is a comparison chart between all the embedded profiles:
debug-dev |
dev |
staging |
prod |
|
---|---|---|---|---|
Database engine | H2 | H2 | H2 | H2 |
Storage type | File | In-Memory | File | File |
Schema migrator | Hibernate | Hibernate | Flyway | Flyway |
Database population | Yes | Yes | Yes | No |
Database persistence | Yes | No | Yes | Yes |
Might need deletion | Yes | No | Yes | No |
Verbosity | Trace + Hibernate | Debug | Info | Info |
Performance | Horrible | Bad | Ok | Ok |
The database population file is located at $PROJECT_DIR$/src/main/resources/db/data/standard/populate.sql
.
Here are the URL of all profiles to their database:
URL | |
---|---|
debug-dev |
jdbc:h2:file:$PROJECT_DIR$/.h2/coding_assignment_becare_debug_dev;AUTO_SERVER=TRUE |
dev |
jdbc:h2:mem:coding_assignment_becare_dev |
staging |
jdbc:h2:file:$PROJECT_DIR$/.h2/coding_assignment_becare_staging;AUTO_SERVER=TRUE |
prod |
jdbc:h2:file:$PROJECT_DIR$/.h2/coding_assignment_becare_prod;AUTO_SERVER=TRUE |
If you wish to reset a database just delete its file after the application shutdown.
-
Launch the application with the
prod
profile.java -jar target/coding-assignment.becare-<version>.jar -Dspring.profiles.active=prod
-
Navigate to http://localhost:8080.
-
Launch Postman and do some requests.
Exports are located at
$PROJECT_DIR$/postman
.
This project was implemented on IntelliJ IDEA. All the needed configuration is kept in this repository.
You do not need to import this project in IntelliJ IDEA, just open it!
- Implement more tests (they are too few tests in number, I lack of time).
- Reach 90% code coverage.