You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where we can find a working H2 embedded database connection for the default profile and the staging and production configurations examples for working with an external database.
68
+
69
+
### Security
70
+
All the boilerplate for the initial Spring Security configuration is already created. These are they key classes:
71
+
72
+
-[User](src/main/java/com/dlizarra/starter/user/User.java), [Role](src/main/java/com/dlizarra/starter/role/Role.java) and [RoleName](src/main/java/com/dlizarra/starter/role/RoleName.java) which are populated by [data.sql](src/main/resources/data.sql) file for the default profile only.
-[SecurityConfig](src/main/java/com/dlizarra/starter/SecurityConfig.java) with just very basic security rules.
76
+
77
+
### DTO-Entity mapping
78
+
The project includes Orika and it already has a class, [OrikaBeanMapper](src/main/java/com/dlizarra/starter/support/orika/OrikaBeanMapper.java), ready to be injected anywhere and be used to do any mapping. It will also scan the project on startup searching for custom mappers and components.
79
+
80
+
You can see how to use it in [UserServiceImpl](src/main/java/com/dlizarra/starter/user/UserServiceImpl.java) or in this sample [project](https://github.com/dlizarra/orika-spring-integration).
81
+
82
+
This, along with Lombok annotations for auto-generating getters, setters, toString methods and such, allows us to have much cleaner Entities and DTOs classes.
83
+
84
+
### Unit and integration testing
85
+
For **unit testing** we included Spring Test, JUnit, Mockito and AssertJ as well as an [AbstractUnitTest](src/test/java/com/dlizarra/starter/support/AbstractUnitTest.java) class that we can extend to include the boilerplate annotations and configuration for every test. [UserServiceTest](src/test/java/com/dlizarra/starter/user/UserServiceTest.java) can serve as an example.
86
+
87
+
To create integration tests we can extend [AbstractIntegrationTest](src/test/java/com/dlizarra/starter/support/AbstractIntegrationTest.java) and make use of Spring `@sql` annotation to run a databse script before every test, just like it's done in [UserRepositoryTest](src/test/java/com/dlizarra/starter/user/UserRepositoryTest.java).
88
+
89
+
### Code coverage
90
+
The project is also ready to use Cobertura as a code coverage utility and Coveralls to show a nice graphical representation of the results, get a badge with the results, etc.
91
+
92
+
The only thing you need to do is to create an account in [Coveralls.io](http://coveralls.io) and add your repo token key [here](pom.xml#L134) in the pom.xml.
93
+
94
+
And if you want to use different tools you just need to remove the plugins from the pom.
95
+
96
+
### Continuous integration and deployment
97
+
A [travis.yml](.travis.yml) file is included with a minimal configuration just to use jdk 8, trigger the code analysis tool and deploy the app to Heroku using the `api_key` in the file.
98
+
99
+
We also included a Heroku [Procfile](Procfile) which declares the `web` process type and the java command to run our app and specifies which Spring Profile we want to use.
100
+
101
+
### Other ways to run the app
54
102
#### Run everything from Maven
55
103
56
104
mvn generate-resources spring-boot:run
@@ -68,25 +116,27 @@ In a second terminal:
68
116
cd src/main/frontend
69
117
webpack
70
118
71
-
### Profiles
72
-
73
-
The project comes prepared for being used in three different environments plus
74
-
another one for testing. We use Spring Profiles in combination with Boot feature for
75
-
loading properties files by naming convention (application-*\<profile name\>*.properties).
0 commit comments