Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
106642a8
Commit
106642a8
authored
Dec 29, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
f036a89c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
AbstractReactiveWebServerFactoryTests.java
...eactive/server/AbstractReactiveWebServerFactoryTests.java
+2
-2
SpringProfileDocumentMatcherTests.java
...ramework/boot/yaml/SpringProfileDocumentMatcherTests.java
+12
-13
No files found.
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
View file @
106642a8
...
@@ -88,12 +88,12 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -88,12 +88,12 @@ public abstract class AbstractReactiveWebServerFactoryTests {
}
}
@Test
@Test
public
void
basicSslFromClassPath
()
throws
Exception
{
public
void
basicSslFromClassPath
()
{
testBasicSslWithKeyStore
(
"classpath:test.jks"
);
testBasicSslWithKeyStore
(
"classpath:test.jks"
);
}
}
@Test
@Test
public
void
basicSslFromFileSystem
()
throws
Exception
{
public
void
basicSslFromFileSystem
()
{
testBasicSslWithKeyStore
(
"src/test/resources/test.jks"
);
testBasicSslWithKeyStore
(
"src/test/resources/test.jks"
);
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/yaml/SpringProfileDocumentMatcherTests.java
View file @
106642a8
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
package
org
.
springframework
.
boot
.
yaml
;
package
org
.
springframework
.
boot
.
yaml
;
import
java.io.IOException
;
import
java.util.Properties
;
import
java.util.Properties
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -37,42 +36,42 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -37,42 +36,42 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
SpringProfileDocumentMatcherTests
{
public
class
SpringProfileDocumentMatcherTests
{
@Test
@Test
public
void
matchesSingleProfile
()
throws
IOException
{
public
void
matchesSingleProfile
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.ProfILEs: foo"
);
Properties
properties
=
getProperties
(
"spring.ProfILEs: foo"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
abstainNoConfiguredProfiles
()
throws
IOException
{
public
void
abstainNoConfiguredProfiles
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"some.property: spam"
);
Properties
properties
=
getProperties
(
"some.property: spam"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
ABSTAIN
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
ABSTAIN
);
}
}
@Test
@Test
public
void
noActiveProfiles
()
throws
IOException
{
public
void
noActiveProfiles
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
();
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
();
Properties
properties
=
getProperties
(
"spring.profiles: bar,spam"
);
Properties
properties
=
getProperties
(
"spring.profiles: bar,spam"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
}
}
@Test
@Test
public
void
matchesCommaSeparatedString
()
throws
IOException
{
public
void
matchesCommaSeparatedString
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.profiles: bar,spam"
);
Properties
properties
=
getProperties
(
"spring.profiles: bar,spam"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
matchesCommaSeparatedArray
()
throws
IOException
{
public
void
matchesCommaSeparatedArray
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.profiles: [bar, spam]"
);
Properties
properties
=
getProperties
(
"spring.profiles: [bar, spam]"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
matchesList
()
throws
IOException
{
public
void
matchesList
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
Properties
properties
=
getProperties
(
String
.
format
(
"spring.profiles:%n - bar%n - spam"
));
String
.
format
(
"spring.profiles:%n - bar%n - spam"
));
...
@@ -80,42 +79,42 @@ public class SpringProfileDocumentMatcherTests {
...
@@ -80,42 +79,42 @@ public class SpringProfileDocumentMatcherTests {
}
}
@Test
@Test
public
void
noMatchingProfiles
()
throws
IOException
{
public
void
noMatchingProfiles
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.profiles: baz,blah"
);
Properties
properties
=
getProperties
(
"spring.profiles: baz,blah"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
}
}
@Test
@Test
public
void
inverseMatchSingle
()
throws
IOException
{
public
void
inverseMatchSingle
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz'"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz'"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
testInverseMatchMulti
()
throws
IOException
{
public
void
testInverseMatchMulti
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,!blah'"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,!blah'"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
negatedWithMatch
()
throws
Exception
{
public
void
negatedWithMatch
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
,
"blah"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
,
"blah"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,blah'"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,blah'"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
FOUND
);
}
}
@Test
@Test
public
void
negatedWithNoMatch
()
throws
IOException
{
public
void
negatedWithNoMatch
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
,
"blah"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"bar"
,
"blah"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,another'"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,another'"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
}
}
@Test
@Test
public
void
negatedTrumpsMatching
()
throws
IOException
{
public
void
negatedTrumpsMatching
()
{
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"baz"
,
"blah"
);
DocumentMatcher
matcher
=
new
SpringProfileDocumentMatcher
(
"foo"
,
"baz"
,
"blah"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,blah'"
);
Properties
properties
=
getProperties
(
"spring.profiles: '!baz,blah'"
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
assertThat
(
matcher
.
matches
(
properties
)).
isEqualTo
(
MatchStatus
.
NOT_FOUND
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment