File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure
spring-boot-web-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org.apache.shiro.spring.boot.autoconfigure
2
+
3
+ import org.junit.Test
4
+
5
+ import static org.hamcrest.MatcherAssert.assertThat
6
+ import static org.hamcrest.Matchers.matchesPattern
7
+ import static org.hamcrest.Matchers.not
8
+
9
+ class SpringFactoriesTest {
10
+
11
+ @Test
12
+ void springFactoriesConfigContainsNoWhitespace () {
13
+ Properties props = new Properties ()
14
+ props. load(new FileReader (" src/main/resources/META-INF/spring.factories" ))
15
+ assertNoWhitespaceInEntries(props)
16
+ }
17
+
18
+ static private assertNoWhitespaceInEntries (Properties props ) {
19
+ props. each{ key , val ->
20
+ assertThat " Property [${ key} ] contains whitespace" ,
21
+ props. get(" org.springframework.boot.autoconfigure.EnableAutoConfiguration" ), not(matchesPattern(" .*\\ s.*" ))
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ package org.apache.shiro.spring.boot.autoconfigure.web
2
+
3
+ import org.junit.Test
4
+
5
+ import static org.hamcrest.MatcherAssert.assertThat
6
+ import static org.hamcrest.Matchers.matchesPattern
7
+ import static org.hamcrest.Matchers.not
8
+
9
+ class WebSpringFactoriesTest {
10
+
11
+ @Test
12
+ void springFactoriesConfigContainsNoWhitespace () {
13
+ Properties props = new Properties ()
14
+ props. load(new FileReader (" src/main/resources/META-INF/spring.factories" ))
15
+ assertNoWhitespaceInEntries(props)
16
+ }
17
+
18
+ static private assertNoWhitespaceInEntries (Properties props ) {
19
+ props. each{ key , val ->
20
+ assertThat " Property [${ key} ] contains whitespace" ,
21
+ props. get(" org.springframework.boot.autoconfigure.EnableAutoConfiguration" ), not(matchesPattern(" .*\\ s.*" ))
22
+ }
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments