spring-gen 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/commands/resource.rb +19 -18
- data/lib/commands/service.rb +1 -0
- data/lib/spring-gen/version.rb +1 -1
- data/lib/templates/layout/src/java/config/AppConfig.java.erb +5 -5
- data/lib/templates/layout/src/java/main/App.java.erb +1 -1
- data/lib/templates/resource/assembler/Assembler.java.erb +4 -4
- data/lib/templates/resource/assembler/BaseAssembler.java.erb +2 -2
- data/lib/templates/resource/controller/BaseController.java.erb +3 -3
- data/lib/templates/resource/controller/Controller.java.erb +5 -5
- data/lib/templates/resource/exception/NotCreatedException.java.erb +1 -1
- data/lib/templates/resource/model/JpaBaseEntity.java.erb +1 -1
- data/lib/templates/resource/model/Model.java.erb +1 -1
- data/lib/templates/resource/model/MongodbBaseEntity.java.erb +1 -1
- data/lib/templates/resource/model/Neo4jBaseEntity.java.erb +1 -1
- data/lib/templates/resource/repository/Repository.java.erb +2 -2
- data/lib/templates/resource/resource/Resource.java.erb +2 -2
- data/lib/templates/resource/test/TestUtil.java.erb +1 -1
- data/lib/templates/resource/test/integration/jpa/IntegrationTest.java.erb +3 -3
- data/lib/templates/resource/test/integration/jpa/IntegrationTestConfig.java.erb +9 -9
- data/lib/templates/resource/test/integration/mongodb/IntegrationTest.java.erb +3 -3
- data/lib/templates/resource/test/integration/mongodb/IntegrationTestConfig.java.erb +9 -9
- data/lib/templates/resource/test/integration/mongodb/SampleData.java.erb +1 -1
- data/lib/templates/resource/test/integration/neo4j/IntegrationTest.java.erb +3 -3
- data/lib/templates/resource/test/integration/neo4j/IntegrationTestConfig.java.erb +9 -9
- data/lib/templates/resource/test/integration/neo4j/SampleData.java.erb +1 -1
- data/lib/templates/resource/test/unit/assembler/AssemblerUnitTest.java.erb +3 -3
- data/lib/templates/resource/test/unit/assembler/AssemblerUnitTestConfig.java.erb +2 -2
- data/lib/templates/resource/test/unit/controller/ControllerUnitTest.java.erb +6 -6
- data/lib/templates/resource/test/unit/controller/ControllerUnitTestConfig.java.erb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ecaf911ebc51870af3d268372c514350ee6303f
|
4
|
+
data.tar.gz: 93120d0eb78f25f4b8252d28da33c1a3c4ce21d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb25788f33e9ecf4a18e3a3e4a30d02d5526a9d54b171e2c3e037781be0049c50b014ac4cba2ec03e2dead52ad60618358cdbff281c88763ae735cb80e75bb30
|
7
|
+
data.tar.gz: dbac4d670c5b294413c65b7f13afc238165c8a639029e1b8ea325cc3e19f5ea61005715aa0edff1b9917567dbe54b90d92c0fc5e4f4a27cfa413189586d2bc62
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ spring-gen is a rails-like generator for spring microservices.
|
|
5
5
|
## Installation
|
6
6
|
Open a terminal and type
|
7
7
|
```bash
|
8
|
-
gem install
|
8
|
+
gem install spring-gen
|
9
9
|
```
|
10
10
|
|
11
11
|
|
@@ -120,7 +120,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
120
120
|
|
121
121
|
## Copyright
|
122
122
|
Copyright (c) 2015 Rene Richter.
|
123
|
-
|
123
|
+
spring-gen is free software; you can redistribute it and/or modify
|
124
124
|
it under the terms of the GNU General Public License as published by
|
125
125
|
the Free Software Foundation; either version 3 of the License, or
|
126
126
|
(at your option) any later version.
|
data/lib/commands/resource.rb
CHANGED
@@ -30,7 +30,8 @@ class Resource < Thor::Group
|
|
30
30
|
def create_model
|
31
31
|
@user_name = user_name
|
32
32
|
@user_email = user_email
|
33
|
-
@
|
33
|
+
@package = config.group_id.split(".").each {|part| part.gsub!(/\W/,"")}.join(".")
|
34
|
+
fs_path = @package.gsub(".","/")
|
34
35
|
@artifact_id = config.artifact_id
|
35
36
|
@full = options['full']
|
36
37
|
|
@@ -49,35 +50,35 @@ class Resource < Thor::Group
|
|
49
50
|
@annotation_import = 'import org.springframework.data.mongodb.core.mapping.Document;'
|
50
51
|
@entity_annotation = "@Document"
|
51
52
|
template "templates/resource/test/integration/#{config.repository_technique}/SampleData.java.erb",
|
52
|
-
"#{content_root}/src/test/java/#{
|
53
|
+
"#{content_root}/src/test/java/#{fs_path}/integration/#{@model_name.downcase}/#{@model_name}SampleData.java"
|
53
54
|
when "neo4j"
|
54
55
|
@repository_import = "neo4j.repository.GraphRepository"
|
55
56
|
@repository_type = "GraphRepository<#{@model_name}>"
|
56
57
|
@entity_annotation = "@NodeEntity"
|
57
58
|
template "templates/resource/test/integration/#{config.repository_technique}/SampleData.java.erb",
|
58
|
-
"#{content_root}/src/test/java/#{
|
59
|
+
"#{content_root}/src/test/java/#{fs_path}/integration/#{@model_name.downcase}/#{@model_name}SampleData.java"
|
59
60
|
else
|
60
61
|
raise ("not a suitable repository-technique.")
|
61
62
|
end
|
62
63
|
|
63
64
|
|
64
65
|
template "templates/resource/model/#{config.repository_technique.capitalize}BaseEntity.java.erb",
|
65
|
-
"#{content_root}/src/main/java/#{
|
66
|
+
"#{content_root}/src/main/java/#{fs_path}/model/BaseEntity.java"
|
66
67
|
template(
|
67
68
|
'templates/resource/model/Model.java.erb',
|
68
|
-
"#{content_root}/src/main/java/#{
|
69
|
+
"#{content_root}/src/main/java/#{fs_path}/model/#{@model_name}.java")
|
69
70
|
|
70
71
|
template(
|
71
72
|
'templates/resource/repository/Repository.java.erb',
|
72
|
-
"#{content_root}/src/main/java/#{
|
73
|
+
"#{content_root}/src/main/java/#{fs_path}/repository/#{@model_name}Repository.java")
|
73
74
|
|
74
75
|
template(
|
75
76
|
"templates/resource/test/integration/#{config.repository_technique}/IntegrationTestConfig.java.erb",
|
76
|
-
"#{content_root}/src/test/java/#{
|
77
|
+
"#{content_root}/src/test/java/#{fs_path}/integration/#{@model_name.downcase}/#{@model_name}IntegrationTestConfig.java")
|
77
78
|
|
78
79
|
template(
|
79
80
|
"templates/resource/test/integration/#{config.repository_technique}/IntegrationTest.java.erb",
|
80
|
-
"#{content_root}/src/test/java/#{
|
81
|
+
"#{content_root}/src/test/java/#{fs_path}/integration/#{@model_name.downcase}/#{@model_name}IntegrationTest.java")
|
81
82
|
|
82
83
|
|
83
84
|
template(
|
@@ -88,40 +89,40 @@ class Resource < Thor::Group
|
|
88
89
|
|
89
90
|
template(
|
90
91
|
'templates/resource/test/unit/controller/ControllerUnitTestConfig.java.erb',
|
91
|
-
"#{content_root}/src/test/java/#{
|
92
|
+
"#{content_root}/src/test/java/#{fs_path}/unit/#{@model_name.downcase}/controller/#{@model_name}ControllerUnitTestConfig.java")
|
92
93
|
|
93
94
|
template(
|
94
95
|
'templates/resource/test/unit/controller/ControllerUnitTest.java.erb',
|
95
|
-
"#{content_root}/src/test/java/#{
|
96
|
+
"#{content_root}/src/test/java/#{fs_path}/unit/#{@model_name.downcase}/controller/#{@model_name}ControllerUnitTest.java")
|
96
97
|
|
97
98
|
template(
|
98
99
|
'templates/resource/test/unit/assembler/AssemblerUnitTestConfig.java.erb',
|
99
|
-
"#{content_root}/src/test/java/#{
|
100
|
+
"#{content_root}/src/test/java/#{fs_path}/unit/#{@model_name.downcase}/assembler/#{@model_name}AssemblerUnitTestConfig.java")
|
100
101
|
|
101
102
|
template(
|
102
103
|
'templates/resource/test/unit/assembler/AssemblerUnitTest.java.erb',
|
103
|
-
"#{content_root}/src/test/java/#{
|
104
|
+
"#{content_root}/src/test/java/#{fs_path}/unit/#{@model_name.downcase}/assembler/#{@model_name}AssemblerUnitTest.java")
|
104
105
|
|
105
106
|
|
106
107
|
template 'templates/resource/controller/BaseController.java.erb',
|
107
|
-
"#{content_root}/src/main/java/#{
|
108
|
+
"#{content_root}/src/main/java/#{fs_path}/controller/BaseController.java" unless File.exist?("#{content_root}/src/main/java/#{fs_path}/controller/BaseController.java")
|
108
109
|
|
109
110
|
template(
|
110
111
|
'templates/resource/controller/Controller.java.erb',
|
111
|
-
"#{content_root}/src/main/java/#{
|
112
|
+
"#{content_root}/src/main/java/#{fs_path}/controller/#{@model_name}Controller.java")
|
112
113
|
|
113
114
|
template 'templates/resource/assembler/BaseAssembler.java.erb',
|
114
|
-
"#{content_root}/src/main/java/#{
|
115
|
+
"#{content_root}/src/main/java/#{fs_path}/assembler/BaseAssembler.java" unless File.exist?("#{content_root}/src/main/java/#{fs_path}/assembler/BaseAssembler.java")
|
115
116
|
template(
|
116
117
|
'templates/resource/assembler/Assembler.java.erb',
|
117
|
-
"#{content_root}/src/main/java/#{
|
118
|
+
"#{content_root}/src/main/java/#{fs_path}/assembler/#{@model_name}Assembler.java")
|
118
119
|
|
119
120
|
template(
|
120
121
|
'templates/resource/resource/Resource.java.erb',
|
121
|
-
"#{content_root}/src/main/java/#{
|
122
|
+
"#{content_root}/src/main/java/#{fs_path}/resource/#{@model_name}Resource.java")
|
122
123
|
|
123
124
|
template 'templates/resource/exception/NotCreatedException.java.erb',
|
124
|
-
"#{content_root}/src/main/java/#{
|
125
|
+
"#{content_root}/src/main/java/#{fs_path}/exception/NotCreatedException.java" unless File.exist? "#{content_root}/src/main/java/#{fs_path}/exception/NotCreatedException.java"
|
125
126
|
|
126
127
|
end
|
127
128
|
end
|
data/lib/commands/service.rb
CHANGED
data/lib/spring-gen/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.config;
|
2
2
|
|
3
3
|
|
4
4
|
/*
|
@@ -37,14 +37,14 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
37
37
|
|
38
38
|
@Configuration
|
39
39
|
@EnableWebMvc
|
40
|
-
@ComponentScan(basePackages = {"<%=@
|
40
|
+
@ComponentScan(basePackages = {"<%=@package%>"})
|
41
41
|
<%if @repository_technique == "jpa"-%>
|
42
|
-
@EnableJpaRepositories(basePackages = "<%=@
|
42
|
+
@EnableJpaRepositories(basePackages = "<%=@package%>.repository")
|
43
43
|
<%elsif @repository_technique == "mongodb"-%>
|
44
|
-
@EnableMongoRepositories(basePackages = "<%=@
|
44
|
+
@EnableMongoRepositories(basePackages = "<%=@package%>.repository")
|
45
45
|
<%elsif @repository_technique == "neo4j"-%>
|
46
46
|
<%end-%>
|
47
|
-
@EntityScan(basePackages = "<%=@
|
47
|
+
@EntityScan(basePackages = "<%=@package%>.repository")
|
48
48
|
@EnableSpringDataWebSupport
|
49
49
|
public class AppConfig {
|
50
50
|
@Bean
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.assembler;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>
|
@@ -18,9 +18,9 @@ package <%=@group_id%>.assembler;
|
|
18
18
|
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
19
19
|
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
|
20
20
|
|
21
|
-
import <%=@
|
22
|
-
import <%=@
|
23
|
-
import <%=@
|
21
|
+
import <%=@package%>.model.<%=@model_name%>;
|
22
|
+
import <%=@package%>.controller.<%=@model_name%>Controller;
|
23
|
+
import <%=@package%>.resource.<%=@model_name%>Resource;
|
24
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
25
25
|
import org.springframework.hateoas.EntityLinks;
|
26
26
|
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.assembler;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>
|
@@ -15,7 +15,7 @@ package <%=@group_id%>.assembler;
|
|
15
15
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
*/
|
17
17
|
|
18
|
-
import <%=@
|
18
|
+
import <%=@package%>.model.BaseEntity;
|
19
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
20
20
|
import org.springframework.cloud.client.ServiceInstance;
|
21
21
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.controller;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -15,8 +15,8 @@ package <%=@group_id%>.controller;
|
|
15
15
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
*/
|
17
17
|
|
18
|
-
import <%=@
|
19
|
-
import <%=@
|
18
|
+
import <%=@package%>.exception.NotCreatedException;
|
19
|
+
import <%=@package%>.model.BaseEntity;
|
20
20
|
import org.springframework.beans.factory.annotation.Autowired;
|
21
21
|
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
|
22
22
|
import org.springframework.hateoas.EntityLinks;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.controller;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -15,10 +15,10 @@ package <%=@group_id%>.controller;
|
|
15
15
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
*/
|
17
17
|
|
18
|
-
import <%=@
|
19
|
-
import <%=@
|
20
|
-
import <%=@
|
21
|
-
import <%=@
|
18
|
+
import <%=@package%>.assembler.<%=@model_name%>Assembler;
|
19
|
+
import <%=@package%>.model.<%=@model_name%>;
|
20
|
+
import <%=@package%>.resource.<%=@model_name%>Resource;
|
21
|
+
import <%=@package%>.repository.<%=@model_name%>Repository;
|
22
22
|
import org.springframework.beans.factory.annotation.Autowired;
|
23
23
|
import org.springframework.data.domain.Page;
|
24
24
|
import org.springframework.data.domain.Pageable;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.repository;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -15,7 +15,7 @@ package <%=@group_id%>.repository;
|
|
15
15
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
*/
|
17
17
|
|
18
|
-
import <%=@
|
18
|
+
import <%=@package%>.model.<%=@model_name%>;
|
19
19
|
import org.springframework.stereotype.Repository;
|
20
20
|
import org.springframework.data.<%=@repository_import%>;
|
21
21
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.resource;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>
|
@@ -15,7 +15,7 @@ package <%=@group_id%>.resource;
|
|
15
15
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
*/
|
17
17
|
|
18
|
-
import <%=@
|
18
|
+
import <%=@package%>.model.<%=@model_name%>;
|
19
19
|
import org.springframework.hateoas.ResourceSupport;
|
20
20
|
|
21
21
|
/**
|
@@ -17,7 +17,7 @@ package util;
|
|
17
17
|
|
18
18
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
19
19
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
20
|
-
import <%=@
|
20
|
+
import <%=@package%>.model.BaseEntity;
|
21
21
|
import org.springframework.cloud.client.ServiceInstance;
|
22
22
|
import org.springframework.http.MediaType;
|
23
23
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>.routes;
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2015 <%=@user_name%>.
|
4
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -37,8 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|
37
37
|
|
38
38
|
import com.github.springtestdbunit.DbUnitTestExecutionListener;
|
39
39
|
import com.github.springtestdbunit.annotation.DatabaseSetup;
|
40
|
-
import <%=@
|
41
|
-
import <%=@
|
40
|
+
import <%=@package%>.model.<%=@model_name%>;
|
41
|
+
import <%=@package%>.integration.<%=@model_name.downcase%>.<%=@model_name%>IntegrationTestConfig;
|
42
42
|
import org.junit.Before;
|
43
43
|
import org.junit.Test;
|
44
44
|
import org.junit.runner.RunWith;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -27,21 +27,21 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
27
27
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
28
28
|
|
29
29
|
/**
|
30
|
-
* Configuration class for <%=@
|
30
|
+
* Configuration class for <%=@package%> integration test.
|
31
31
|
* @author <%=@user_name%>
|
32
32
|
*/
|
33
33
|
@Configuration
|
34
|
-
<%if @full%>@ComponentScan(basePackages = {"<%=@
|
35
|
-
"<%=@
|
36
|
-
"<%=@
|
37
|
-
"<%=@
|
38
|
-
<%else%>@ComponentScan(basePackages = "<%=@
|
34
|
+
<%if @full%>@ComponentScan(basePackages = {"<%=@package%>.repository",
|
35
|
+
"<%=@package%>.controller",
|
36
|
+
"<%=@package%>.assembler",
|
37
|
+
"<%=@package%>.resource"})
|
38
|
+
<%else%>@ComponentScan(basePackages = "<%=@package%>.repository")<%end%>
|
39
39
|
@EnableHypermediaSupport(type = {EnableHypermediaSupport.HypermediaType.HAL})
|
40
40
|
@EnableSpringDataWebSupport
|
41
41
|
@EnableWebMvc
|
42
42
|
@EnableAutoConfiguration
|
43
|
-
@EnableJpaRepositories(basePackages = "<%=@
|
43
|
+
@EnableJpaRepositories(basePackages = "<%=@package%>.repository")
|
44
44
|
@EnableTransactionManagement
|
45
|
-
@EntityScan(basePackages = {"<%=@
|
45
|
+
@EntityScan(basePackages = {"<%=@package%>.model"})
|
46
46
|
public class <%=@model_name%>IntegrationTestConfig extends WebMvcConfigurerAdapter {
|
47
47
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>;
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2015 <%=@user_name%>.
|
4
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -35,8 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|
35
35
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
36
36
|
|
37
37
|
|
38
|
-
import <%=@
|
39
|
-
import <%=@
|
38
|
+
import <%=@package%>.model.<%=@model_name%>;
|
39
|
+
import <%=@package%>.integration.<%=@model_name.downcase%>.<%=@model_name%>IntegrationTestConfig;
|
40
40
|
import org.junit.Before;
|
41
41
|
import org.junit.Test;
|
42
42
|
import org.junit.runner.RunWith;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -29,21 +29,21 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
29
29
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
30
30
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
31
31
|
/**
|
32
|
-
* Configuration class for <%=@
|
32
|
+
* Configuration class for <%=@package%> integration test.
|
33
33
|
* @author <%=@user_name%>
|
34
34
|
*/
|
35
35
|
@Configuration
|
36
|
-
<%if @full%>@ComponentScan(basePackages = {"<%=@
|
37
|
-
"<%=@
|
38
|
-
"<%=@
|
39
|
-
"<%=@
|
40
|
-
"<%=@
|
41
|
-
<%else%>@ComponentScan(basePackages = {"<%=@
|
36
|
+
<%if @full%>@ComponentScan(basePackages = {"<%=@package%>.repository",
|
37
|
+
"<%=@package%>.controller",
|
38
|
+
"<%=@package%>.assembler",
|
39
|
+
"<%=@package%>.resource",
|
40
|
+
"<%=@package%>.integration"})
|
41
|
+
<%else%>@ComponentScan(basePackages = {"<%=@package%>.repository","<%=@package%>.integration"})<%end%>
|
42
42
|
@EnableHypermediaSupport(type = {EnableHypermediaSupport.HypermediaType.HAL})
|
43
43
|
@EnableSpringDataWebSupport
|
44
44
|
@EnableWebMvc
|
45
45
|
@EnableAutoConfiguration
|
46
|
-
@EnableMongoRepositories(basePackages = "<%=@
|
46
|
+
@EnableMongoRepositories(basePackages = "<%=@package%>.repository")
|
47
47
|
@EnableTransactionManagement
|
48
48
|
public class <%=@model_name%>IntegrationTestConfig extends WebMvcConfigurerAdapter {
|
49
49
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>;
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2015 <%=@user_name%>.
|
4
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -37,8 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|
37
37
|
|
38
38
|
import com.github.springtestdbunit.DbUnitTestExecutionListener;
|
39
39
|
import com.github.springtestdbunit.annotation.DatabaseSetup;
|
40
|
-
import <%=@
|
41
|
-
import <%=@
|
40
|
+
import <%=@package%>.model.<%=@model_name%>;
|
41
|
+
import <%=@package%>.integration.<%=@model_name.downcase%>.<%=@model_name%>IntegrationTestConfig;
|
42
42
|
import org.junit.Before;
|
43
43
|
import org.junit.Test;
|
44
44
|
import org.junit.runner.RunWith;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.integration.<%=@model_name.downcase%>;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -27,21 +27,21 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
27
27
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
28
28
|
|
29
29
|
/**
|
30
|
-
* Configuration class for <%=@
|
30
|
+
* Configuration class for <%=@package%> integration test.
|
31
31
|
* @author <%=@user_name%>
|
32
32
|
*/
|
33
33
|
@Configuration
|
34
|
-
<%if @full%>@ComponentScan(basePackages = {"<%=@
|
35
|
-
"<%=@
|
36
|
-
"<%=@
|
37
|
-
"<%=@
|
38
|
-
<%else%>@ComponentScan(basePackages = "<%=@
|
34
|
+
<%if @full%>@ComponentScan(basePackages = {"<%=@package%>.repository",
|
35
|
+
"<%=@package%>.controller",
|
36
|
+
"<%=@package%>.assembler",
|
37
|
+
"<%=@package%>.resource"})
|
38
|
+
<%else%>@ComponentScan(basePackages = "<%=@package%>.repository")<%end%>
|
39
39
|
@EnableHypermediaSupport(type = {EnableHypermediaSupport.HypermediaType.HAL})
|
40
40
|
@EnableSpringDataWebSupport
|
41
41
|
@EnableWebMvc
|
42
42
|
@EnableAutoConfiguration
|
43
|
-
@EnableJpaRepositories(basePackages = "<%=@
|
43
|
+
@EnableJpaRepositories(basePackages = "<%=@package%>.repository")
|
44
44
|
@EnableTransactionManagement
|
45
|
-
@EntityScan(basePackages = {"<%=@
|
45
|
+
@EntityScan(basePackages = {"<%=@package%>.model"})
|
46
46
|
public class <%=@model_name%>IntegrationTestConfig extends WebMvcConfigurerAdapter {
|
47
47
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.unit.<%=@model_name.downcase%>.assembler;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -17,8 +17,8 @@ package <%=@group_id%>.unit.<%=@model_name.downcase%>.assembler;
|
|
17
17
|
|
18
18
|
import static org.junit.Assert.assertEquals;
|
19
19
|
|
20
|
-
import <%=@
|
21
|
-
import <%=@
|
20
|
+
import <%=@package%>.assembler.<%=@model_name%>Assembler;
|
21
|
+
import <%=@package%>.model.<%=@model_name%>;
|
22
22
|
import org.junit.Before;
|
23
23
|
import org.junit.Test;
|
24
24
|
import org.junit.runner.RunWith;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.unit.<%=@model_name.downcase%>.assembler;
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2015 <%=@user_name%>.
|
4
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -15,7 +15,7 @@ package <%=@group_id%>.unit.<%=@model_name.downcase%>.assembler;
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
|
18
|
-
import <%=@
|
18
|
+
import <%=@package%>.assembler.<%=@model_name%>Assembler;
|
19
19
|
import org.mockito.Mockito;
|
20
20
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
|
21
21
|
import org.springframework.context.annotation.Bean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.unit.<%=@model_name.downcase%>.controller;
|
2
2
|
/*
|
3
3
|
* Copyright (c) 2015 <%=@user_name%>.
|
4
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -23,11 +23,11 @@ import static org.mockito.Mockito.verify;
|
|
23
23
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
24
24
|
import static org.mockito.Mockito.when;
|
25
25
|
|
26
|
-
import <%=@
|
27
|
-
import <%=@
|
28
|
-
import <%=@
|
29
|
-
import <%=@
|
30
|
-
import <%=@
|
26
|
+
import <%=@package%>.assembler.<%=@model_name%>Assembler;
|
27
|
+
import <%=@package%>.controller.<%=@model_name%>Controller;
|
28
|
+
import <%=@package%>.repository.<%=@model_name%>Repository;
|
29
|
+
import <%=@package%>.resource.<%=@model_name%>Resource;
|
30
|
+
import <%=@package%>.model.<%=@model_name%>;
|
31
31
|
import org.junit.Before;
|
32
32
|
import org.junit.Test;
|
33
33
|
import org.junit.runner.RunWith;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package <%=@
|
1
|
+
package <%=@package%>.unit.<%=@model_name.downcase%>.controller;
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Copyright (c) 2015 <%=@user_name%>.
|
@@ -16,9 +16,9 @@ package <%=@group_id%>.unit.<%=@model_name.downcase%>.controller;
|
|
16
16
|
*/
|
17
17
|
|
18
18
|
|
19
|
-
import <%=@
|
20
|
-
import <%=@
|
21
|
-
import <%=@
|
19
|
+
import <%=@package%>.assembler.<%=@model_name%>Assembler;
|
20
|
+
import <%=@package%>.repository.<%=@model_name%>Repository;
|
21
|
+
import <%=@package%>.controller.<%=@model_name%>Controller;
|
22
22
|
import org.mockito.Mockito;
|
23
23
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
|
24
24
|
import org.springframework.context.annotation.Bean;
|