/back
/src
/main
/java
/resources
/test
/java
/resources
/config
/local_gradle
/readme
src/main: Source code.src/test: Test code.config: Configuration files.local_gradle: Local gradle modules folder.readme: Readme attachments folder.
- Backend is organized in package inside
src/main/java. - Backend environment information is in
src/*/resource/config/application-*.yml.- With the current configuration, all environments information is inside the assembled Backend JAR.
*Test.java: Unit test file*IntegrationTest.java: Integration test file
Only use Test and IntegrationTest suffix for Test classes name, tests are processed based on this.
gradlew :back:tasks: Lists the runnable tasks for backend project.
application.yml: Contains information common to any environment (values can be overridden independently by other files).application-test.yml: Contains information for test environment.
gradlew run -Dspring.profiles.active=selectedEnvironment: will run the project in selectedEnvironment.
- e.g.:
gradlew run -Dspring.profiles.active=testwill run the project the environment defined inapplication.yml+application-test.yml. - Go to the web browser look at the url: http://localhost:8080/
Uses Checkstyle + PMD[1].
Checkstyle and PMD, in their different modalities, can be executed independently[2]:
gradlew checkstyleMaingradlew checkstyleUnitTestgradlew checkstyleIntegrationTestgradlew pmdMaingradlew pmdUnitTestgradlew pmdIntegrationTest
Rules are defined in base-style-config project.
[1] PMD is run after Checkstyle, since Checkstyle is "lighter".
[2] The common parts between checks of Unit Tests and Integration Tests are done first, seeTEST_COMMON_SOURCEinback.gradle(if not Checkstyle will fail to report some things due to thechecks_suppressions.xmlfile)
- Unit test are JUnit test defined in
*Test.javafiles. - Integration test are JUnit test defined in
*IntegrationTest.javafiles. - Environment for test can be set on the
application-test.yml
Only use Test and IntegrationTest suffix for Test classes name, tests are processed based on this.
Use doc task to generate Java documentation.
