Skip to content

Commit 05dcd91

Browse files
author
Greg Meyer
authored
Merge pull request #4 from DirectProjectJavaRI/develop
Releasing 8.0.0
2 parents d56fab9 + 762487f commit 05dcd91

File tree

68 files changed

+771
-760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+771
-760
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
hs_err_pid*
2424
/.project
2525
/.classpath
26+
/target/

pom.xml

Lines changed: 42 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.nhind</groupId>
55
<artifactId>config-service-client</artifactId>
6-
<version>6.0</version>
6+
<version>8.0.0</version>
77
<packaging>jar</packaging>
88
<name>NHIN Direct Java config service client proxy</name>
99
<description>NHIN Direct Java config service client proxy</description>
1010
<url>http://api.nhindirect.org/x/www/api.nhindirect.org/java/site/config/config-service-client/${project.version}</url>
11-
<parent>
11+
<parent>
1212
<groupId>org.springframework.boot</groupId>
1313
<artifactId>spring-boot-dependencies</artifactId>
14-
<version>2.1.2.RELEASE</version>
15-
</parent>
14+
<version>2.5.2</version>
15+
<relativePath />
16+
</parent>
1617
<scm>
1718
<url>scm:git:https://github.com/DirectProjectJavaRI/config-service-client.git</url>
1819
<connection>scm:git:https://github.com/DirectProjectJavaRI/config-service-client.git</connection>
@@ -28,18 +29,17 @@
2829
</developer>
2930
</developers>
3031
<prerequisites>
31-
<maven>3.0.0</maven>
32+
<maven>3.5.0</maven>
3233
</prerequisites>
3334
<licenses>
3435
<license>
3536
<name>New BSD License</name>
3637
<url>http://nhindirect.org/BSDLicense</url>
3738
</license>
38-
</licenses>
39-
39+
</licenses>
4040
<properties>
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42-
<spring-cloud-dependencies.version>Greenwich.RELEASE</spring-cloud-dependencies.version>
42+
<spring-cloud-dependencies.version>2020.0.3</spring-cloud-dependencies.version>
4343
</properties>
4444
<dependencyManagement>
4545
<dependencies>
@@ -60,67 +60,58 @@
6060
<dependency>
6161
<groupId>org.nhind</groupId>
6262
<artifactId>config-model</artifactId>
63-
<version>6.0</version>
63+
<version>8.0.0</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>org.nhind</groupId>
6767
<artifactId>direct-common</artifactId>
68-
<version>6.0</version>
68+
<version>8.0.0</version>
6969
</dependency>
7070
<dependency>
7171
<groupId>org.springframework.cloud</groupId>
7272
<artifactId>spring-cloud-starter-openfeign</artifactId>
73-
<exclusions>
74-
<exclusion>
75-
<groupId>org.bouncycastle</groupId>
76-
<artifactId>bcpkix-jdk15on</artifactId>
77-
</exclusion>
78-
</exclusions>
7973
</dependency>
8074
<dependency>
8175
<groupId>org.springframework.boot</groupId>
8276
<artifactId>spring-boot-starter-test</artifactId>
8377
<scope>test</scope>
84-
</dependency>
85-
<dependency>
86-
<groupId>org.apache.camel</groupId>
87-
<artifactId>camel-spring-boot-starter</artifactId>
88-
<version>2.22.0</version>
89-
<scope>test</scope>
9078
</dependency>
91-
<dependency>
92-
<groupId>junit</groupId>
93-
<artifactId>junit</artifactId>
94-
<scope>test</scope>
95-
</dependency>
96-
<dependency>
97-
<groupId>org.apache.mina</groupId>
98-
<artifactId>mina-core</artifactId>
99-
<version>1.0.2</version>
100-
<scope>test</scope>
101-
</dependency>
102-
<dependency>
103-
<groupId>dnsjava</groupId>
104-
<artifactId>dnsjava</artifactId>
105-
<version>2.0.8</version>
106-
<scope>test</scope>
107-
</dependency>
10879
<dependency>
10980
<groupId>org.nhind</groupId>
11081
<artifactId>config-service-jar</artifactId>
111-
<version>6.0</version>
82+
<version>8.0.0</version>
11283
<scope>test</scope>
113-
</dependency>
114-
<dependency>
115-
<groupId>org.mockito</groupId>
116-
<artifactId>mockito-core</artifactId>
117-
<scope>test</scope>
118-
</dependency>
84+
</dependency>
11985
<dependency>
12086
<groupId>com.h2database</groupId>
12187
<artifactId>h2</artifactId>
12288
<scope>test</scope>
123-
</dependency>
89+
</dependency>
90+
<dependency>
91+
<groupId>io.r2dbc</groupId>
92+
<artifactId>r2dbc-h2</artifactId>
93+
<scope>test</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>org.springframework.boot</groupId>
97+
<artifactId>spring-boot-starter-tomcat</artifactId>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.springframework.boot</groupId>
102+
<artifactId>spring-boot-starter-webflux</artifactId>
103+
<scope>test</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.springframework</groupId>
107+
<artifactId>spring-webmvc</artifactId>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.springframework.boot</groupId>
112+
<artifactId>spring-boot-starter-security</artifactId>
113+
<scope>test</scope>
114+
</dependency>
124115
</dependencies>
125116
<build>
126117
<pluginManagement>
@@ -151,9 +142,8 @@
151142
<plugin>
152143
<groupId>org.apache.maven.plugins</groupId>
153144
<artifactId>maven-javadoc-plugin</artifactId>
154-
<version>2.6.1</version>
155145
<configuration>
156-
<additionalparam>-Xdoclint:none</additionalparam>
146+
<additionalJOption>-Xdoclint:none</additionalJOption>
157147
<charset>UTF-8</charset>
158148
<docencoding>UTF-8</docencoding>
159149
<docfilessubdirs>true</docfilessubdirs>
@@ -185,6 +175,7 @@
185175
</goals>
186176
</execution>
187177
</executions>
178+
<version>3.0.1</version>
188179
</plugin>
189180
-->
190181
</plugins>
@@ -194,14 +185,12 @@
194185
<plugin>
195186
<groupId>org.apache.maven.plugins</groupId>
196187
<artifactId>maven-project-info-reports-plugin</artifactId>
197-
<version>2.9</version>
198188
</plugin>
199189
<plugin>
200190
<groupId>org.apache.maven.plugins</groupId>
201191
<artifactId>maven-javadoc-plugin</artifactId>
202-
<version>2.6.1</version>
203192
<configuration>
204-
<additionalparam>-Xdoclint:none</additionalparam>
193+
<additionalJOption>-Xdoclint:none</additionalJOption>
205194
<charset>UTF-8</charset>
206195
<docencoding>UTF-8</docencoding>
207196
<docfilessubdirs>true</docfilessubdirs>
@@ -225,6 +214,7 @@
225214
<plugin>
226215
<groupId>org.apache.maven.plugins</groupId>
227216
<artifactId>maven-jxr-plugin</artifactId>
217+
<version>3.1.1</version>
228218
</plugin>
229219
<plugin>
230220
<groupId>org.codehaus.mojo</groupId>

src/test/java/org/nhind/config/client/SpringBaseTest.java

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.io.File;
44

55
import org.apache.commons.io.FileUtils;
6-
import org.junit.Before;
7-
import org.junit.runner.RunWith;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.extension.ExtendWith;
88
import org.nhind.config.rest.AddressService;
99
import org.nhind.config.rest.AnchorService;
1010
import org.nhind.config.rest.CertPolicyService;
@@ -16,12 +16,14 @@
1616
import org.nhindirect.config.repository.AddressRepository;
1717
import org.nhindirect.config.repository.AnchorRepository;
1818
import org.nhindirect.config.repository.CertPolicyGroupDomainReltnRepository;
19+
import org.nhindirect.config.repository.CertPolicyGroupReltnRepository;
1920
import org.nhindirect.config.repository.CertPolicyGroupRepository;
2021
import org.nhindirect.config.repository.CertPolicyRepository;
2122
import org.nhindirect.config.repository.CertificateRepository;
2223
import org.nhindirect.config.repository.DNSRepository;
2324
import org.nhindirect.config.repository.DomainRepository;
2425
import org.nhindirect.config.repository.SettingRepository;
26+
import org.nhindirect.config.repository.TrustBundleAnchorRepository;
2527
import org.nhindirect.config.repository.TrustBundleDomainReltnRepository;
2628
import org.nhindirect.config.repository.TrustBundleRepository;
2729
import org.nhindirect.config.resources.AddressResource;
@@ -36,9 +38,9 @@
3638
import org.springframework.boot.test.context.SpringBootTest;
3739
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
3840
import org.springframework.test.context.TestPropertySource;
39-
import org.springframework.test.context.junit4.SpringRunner;
41+
import org.springframework.test.context.junit.jupiter.SpringExtension;
4042

41-
@RunWith(SpringRunner.class)
43+
@ExtendWith(SpringExtension.class)
4244
@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT)
4345
@TestPropertySource("classpath:bootstrap.properties")
4446
public abstract class SpringBaseTest
@@ -99,6 +101,9 @@ public abstract class SpringBaseTest
99101
@Autowired
100102
protected TrustBundleRepository bundleRepo;
101103

104+
@Autowired
105+
protected TrustBundleAnchorRepository bundleAnchorRepo;
106+
102107
@Autowired
103108
protected TrustBundleDomainReltnRepository bundleDomainRepo;
104109

@@ -124,9 +129,12 @@ public abstract class SpringBaseTest
124129
protected CertPolicyGroupRepository policyGroupRepo;
125130

126131
@Autowired
127-
protected CertPolicyGroupDomainReltnRepository groupReltnRepo;
132+
protected CertPolicyGroupDomainReltnRepository groupDomainReltnRepo;
133+
134+
@Autowired
135+
protected CertPolicyGroupReltnRepository policyGroupReltn;
128136

129-
@Before
137+
@BeforeEach
130138
public void setUp()
131139
{
132140

@@ -161,26 +169,30 @@ public void setUp()
161169

162170
protected void cleanDataStore() throws Exception
163171
{
164-
anchorRepo.deleteAll();
172+
anchorRepo.deleteAll().block();
173+
174+
groupDomainReltnRepo.deleteAll().block();
175+
176+
policyGroupReltn.deleteAll().block();
165177

166-
groupReltnRepo.deleteAll();
178+
addressRepo.deleteAll().block();
167179

168-
addressRepo.deleteAll();
180+
bundleAnchorRepo.deleteAll().block();
169181

170-
bundleDomainRepo.deleteAll();
182+
bundleDomainRepo.deleteAll().block();
171183

172-
bundleRepo.deleteAll();
184+
bundleRepo.deleteAll().block();
173185

174-
domainRepo.deleteAll();
186+
domainRepo.deleteAll().block();
175187

176-
policyGroupRepo.deleteAll();
188+
policyGroupRepo.deleteAll().block();
177189

178-
policyRepo.deleteAll();
190+
policyRepo.deleteAll().block();
179191

180-
certRepo.deleteAll();
192+
certRepo.deleteAll().block();
181193

182-
dnsRepo.deleteAll();
194+
dnsRepo.deleteAll().block();
183195

184-
settingRepo.deleteAll();
196+
settingRepo.deleteAll().block();
185197
}
186198
}

src/test/java/org/nhind/config/client/TestApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
56
import org.springframework.cloud.openfeign.EnableFeignClients;
67
import org.springframework.context.annotation.ComponentScan;
8+
import org.springframework.context.annotation.Import;
9+
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
10+
711

812
@SpringBootApplication
913
@ComponentScan({"org.nhindirect.config", "org.nhind.config"})
1014
@EnableFeignClients({"org.nhind.config.rest.feign"})
15+
@EnableR2dbcRepositories("org.nhindirect.config.repository")
16+
@Import(HttpMessageConvertersAutoConfiguration.class)
1117
public class TestApplication
1218
{
1319
public static void main(String[] args)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.nhind.config.client;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
6+
import org.springframework.security.config.annotation.web.builders.WebSecurity;
7+
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
8+
import org.springframework.security.web.firewall.DefaultHttpFirewall;
9+
import org.springframework.security.web.firewall.HttpFirewall;
10+
11+
@Configuration
12+
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter
13+
{
14+
@Bean
15+
public HttpFirewall allowUrlEncodedSlashHttpFirewall()
16+
{
17+
DefaultHttpFirewall firewall = new DefaultHttpFirewall();
18+
firewall.setAllowUrlEncodedSlash(true);
19+
return firewall;
20+
}
21+
22+
@Override
23+
public void configure(WebSecurity web) throws Exception
24+
{
25+
super.configure(web);
26+
web.httpFirewall(allowUrlEncodedSlashHttpFirewall());
27+
}
28+
29+
@Override
30+
protected void configure(HttpSecurity httpSecurity) throws Exception
31+
{
32+
httpSecurity.authorizeRequests().antMatchers("/").permitAll();
33+
httpSecurity.csrf().disable();
34+
}
35+
36+
37+
38+
}
39+

0 commit comments

Comments
 (0)