- JDK 11 or higher
- Maven 3.5.0 or higher
- JAR:
mvn clean package -DskipTests=true
- Docker Image:
docker build . -t ${IMAGE_TAG}
- JAR:
java -jar api.jar --spring.config.location=classpath:/application.properties,${PATH_TO_API_PROPERTIES}/api.properties
- Docker Image:
docker run --name=${CONTAINER_NAME_OF_CHOICE} --mount type=bind,source=${PATH_TO_API_PROPERTIES}/api.properties,target=/etc/osahft/api.properties ${IMAGE_TAG}
- start elasticsearch (e.g.
docker run --name elasticsearch -e "discovery.type=single-node" -p 9200:9200 elasticsearch:7.14.2
) - create an
test.properties
file frompackages/api/src/test/resources/test.properties.example
and store it atpackages/api/src/test/resources/test.properties
- run
mvn test
- open pom.xml
- set the parameter
skip
of theconfiguration
section of theassertj-assertions-generator-maven-plugin
tofalse
- run
mvn clean package -DskipTests=true && mvn assertj:generate-assertions
- copy the newly generated assertions
from
target/generated-test-sources/assertj-assertions/com/osahft/api/internal/assertion
tosrc/test/java/com/osahft/api/internal/assertion
(Make sure you only copy the missing ones) - set the parameter
skip
of theconfiguration
section of theassertj-assertions-generator-maven-plugin
totrue
(restore original state) - open
src/test/java/com/osahft/api/internal/assertion/Assertions.java
and add theassertThat
methods representing the asserts you just generated / copied - run
mvn clean package -DskipTests=true
to make sure that nothing went wrong
To run the api with https use the following tutorial
https://www.baeldung.com/spring-boot-https-self-signed-certificate
- if you get an error similar to
No qualifying bean of type 'org.springframework.boot.info.BuildProperties' available
you should delegate IDE build/run actions to maven (Intellij: Settings > Build, Execution, Deployment > Build Tools > Maven > Runner > checkDelegate IDE build/run actions to Maven
)