Merge branch '2.0.x' into 2.1.x
This commit is contained in:
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -28,7 +28,7 @@ added after the original pull request but before a merge.
|
|||||||
you can import formatter settings using the
|
you can import formatter settings using the
|
||||||
`eclipse-code-formatter.xml` file from the
|
`eclipse-code-formatter.xml` file from the
|
||||||
[Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
|
[Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
|
||||||
[Eclipse Code Formatter Plugin](http://plugins.jetbrains.com/plugin/6546) to import the same file.
|
[Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546) to import the same file.
|
||||||
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
|
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
|
||||||
`@author` tag identifying you, and preferably at least a paragraph on what the class is
|
`@author` tag identifying you, and preferably at least a paragraph on what the class is
|
||||||
for.
|
for.
|
||||||
@@ -40,6 +40,6 @@ added after the original pull request but before a merge.
|
|||||||
* A few unit tests would help a lot as well -- someone has to do it.
|
* A few unit tests would help a lot as well -- someone has to do it.
|
||||||
* If no-one else is using your branch, please rebase it against the current master (or
|
* If no-one else is using your branch, please rebase it against the current master (or
|
||||||
other target branch in the main project).
|
other target branch in the main project).
|
||||||
* When writing a commit message please follow [these conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
* When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
||||||
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
|
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
|
||||||
message (where XXXX is the issue number).
|
message (where XXXX is the issue number).
|
||||||
|
|||||||
152
README.adoc
152
README.adoc
@@ -1,4 +1,8 @@
|
|||||||
// Do not edit this file (e.g. go instead to src/main/asciidoc)
|
////
|
||||||
|
DO NOT EDIT THIS FILE. IT WAS GENERATED.
|
||||||
|
Manual changes to this file will be lost when it is generated again.
|
||||||
|
Edit the files in the src/main/asciidoc/ directory instead.
|
||||||
|
////
|
||||||
|
|
||||||
= Spring Cloud for Cloudfoundry
|
= Spring Cloud for Cloudfoundry
|
||||||
|
|
||||||
@@ -65,7 +69,7 @@ credentials and you already have those.
|
|||||||
|
|
||||||
The projects that require middleware generally include a
|
The projects that require middleware generally include a
|
||||||
`docker-compose.yml`, so consider using
|
`docker-compose.yml`, so consider using
|
||||||
http://compose.docker.io/[Docker Compose] to run the middeware servers
|
https://docs.docker.com/compose/[Docker Compose] to run the middeware servers
|
||||||
in Docker containers. See the README in the
|
in Docker containers. See the README in the
|
||||||
https://github.com/spring-cloud-samples/scripts[scripts demo
|
https://github.com/spring-cloud-samples/scripts[scripts demo
|
||||||
repository] for specific instructions about the common cases of mongo,
|
repository] for specific instructions about the common cases of mongo,
|
||||||
@@ -87,13 +91,13 @@ a modified file in the correct place. Just commit it and push the change.
|
|||||||
|
|
||||||
=== Working with the code
|
=== Working with the code
|
||||||
If you don't have an IDE preference we would recommend that you use
|
If you don't have an IDE preference we would recommend that you use
|
||||||
http://www.springsource.com/developer/sts[Spring Tools Suite] or
|
https://www.springsource.com/developer/sts[Spring Tools Suite] or
|
||||||
http://eclipse.org[Eclipse] when working with the code. We use the
|
https://eclipse.org[Eclipse] when working with the code. We use the
|
||||||
http://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
|
https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
|
||||||
should also work without issue as long as they use Maven 3.3.3 or better.
|
should also work without issue as long as they use Maven 3.3.3 or better.
|
||||||
|
|
||||||
==== Importing into eclipse with m2eclipse
|
==== Importing into eclipse with m2eclipse
|
||||||
We recommend the http://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
|
We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
|
||||||
eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
|
eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
|
||||||
marketplace".
|
marketplace".
|
||||||
|
|
||||||
@@ -149,7 +153,7 @@ added after the original pull request but before a merge.
|
|||||||
`eclipse-code-formatter.xml` file from the
|
`eclipse-code-formatter.xml` file from the
|
||||||
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
|
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
|
||||||
Cloud Build] project. If using IntelliJ, you can use the
|
Cloud Build] project. If using IntelliJ, you can use the
|
||||||
http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
|
https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
|
||||||
Plugin] to import the same file.
|
Plugin] to import the same file.
|
||||||
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
|
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
|
||||||
`@author` tag identifying you, and preferably at least a paragraph on what the class is
|
`@author` tag identifying you, and preferably at least a paragraph on what the class is
|
||||||
@@ -162,6 +166,138 @@ added after the original pull request but before a merge.
|
|||||||
* A few unit tests would help a lot as well -- someone has to do it.
|
* A few unit tests would help a lot as well -- someone has to do it.
|
||||||
* If no-one else is using your branch, please rebase it against the current master (or
|
* If no-one else is using your branch, please rebase it against the current master (or
|
||||||
other target branch in the main project).
|
other target branch in the main project).
|
||||||
* When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
|
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
|
||||||
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
|
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
|
||||||
message (where XXXX is the issue number).
|
message (where XXXX is the issue number).
|
||||||
|
|
||||||
|
=== Checkstyle
|
||||||
|
|
||||||
|
Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
|
||||||
|
|
||||||
|
.spring-cloud-build-tools/
|
||||||
|
----
|
||||||
|
└── src
|
||||||
|
├── checkstyle
|
||||||
|
│ └── checkstyle-suppressions.xml <3>
|
||||||
|
└── main
|
||||||
|
└── resources
|
||||||
|
├── checkstyle-header.txt <2>
|
||||||
|
└── checkstyle.xml <1>
|
||||||
|
----
|
||||||
|
<1> Default Checkstyle rules
|
||||||
|
<2> File header setup
|
||||||
|
<3> Default suppression rules
|
||||||
|
|
||||||
|
==== Checkstyle configuration
|
||||||
|
|
||||||
|
Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
|
||||||
|
|
||||||
|
.pom.xml
|
||||||
|
----
|
||||||
|
<properties>
|
||||||
|
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> <1>
|
||||||
|
<maven-checkstyle-plugin.failsOnViolation>true
|
||||||
|
</maven-checkstyle-plugin.failsOnViolation> <2>
|
||||||
|
<maven-checkstyle-plugin.includeTestSourceDirectory>true
|
||||||
|
</maven-checkstyle-plugin.includeTestSourceDirectory> <3>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin> <4>
|
||||||
|
<groupId>io.spring.javaformat</groupId>
|
||||||
|
<artifactId>spring-javaformat-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin> <5>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin> <5>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
</build>
|
||||||
|
----
|
||||||
|
<1> Fails the build upon Checkstyle errors
|
||||||
|
<2> Fails the build upon Checkstyle violations
|
||||||
|
<3> Checkstyle analyzes also the test sources
|
||||||
|
<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
|
||||||
|
<5> Add checkstyle plugin to your build and reporting phases
|
||||||
|
|
||||||
|
If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
|
||||||
|
|
||||||
|
.projectRoot/src/checkstyle/checkstyle-suppresions.xml
|
||||||
|
----
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE suppressions PUBLIC
|
||||||
|
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||||
|
"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||||
|
<suppressions>
|
||||||
|
<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
|
||||||
|
<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
|
||||||
|
</suppressions>
|
||||||
|
----
|
||||||
|
|
||||||
|
It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
|
||||||
|
$ touch .springformat
|
||||||
|
```
|
||||||
|
|
||||||
|
=== IDE setup
|
||||||
|
|
||||||
|
==== Intellij IDEA
|
||||||
|
|
||||||
|
In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
|
||||||
|
|
||||||
|
.spring-cloud-build-tools/
|
||||||
|
----
|
||||||
|
└── src
|
||||||
|
├── checkstyle
|
||||||
|
│ └── checkstyle-suppressions.xml <3>
|
||||||
|
└── main
|
||||||
|
└── resources
|
||||||
|
├── checkstyle-header.txt <2>
|
||||||
|
├── checkstyle.xml <1>
|
||||||
|
└── intellij
|
||||||
|
├── Intellij_Project_Defaults.xml <4>
|
||||||
|
└── Intellij_Spring_Boot_Java_Conventions.xml <5>
|
||||||
|
----
|
||||||
|
<1> Default Checkstyle rules
|
||||||
|
<2> File header setup
|
||||||
|
<3> Default suppression rules
|
||||||
|
<4> Project defaults for Intellij that apply most of Checkstyle rules
|
||||||
|
<5> Project style conventions for Intellij that apply most of Checkstyle rules
|
||||||
|
|
||||||
|
.Code style
|
||||||
|
|
||||||
|
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
|
||||||
|
|
||||||
|
Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
|
||||||
|
|
||||||
|
.Inspection profiles
|
||||||
|
|
||||||
|
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
|
||||||
|
|
||||||
|
Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
|
||||||
|
|
||||||
|
.Checkstyle
|
||||||
|
|
||||||
|
To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
|
||||||
|
|
||||||
|
image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
|
||||||
|
|
||||||
|
Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
|
||||||
|
|
||||||
|
- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
|
||||||
|
- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
|
||||||
|
- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
|
||||||
|
|
||||||
|
IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function check_if_anything_to_sync() {
|
|||||||
|
|
||||||
function retrieve_current_branch() {
|
function retrieve_current_branch() {
|
||||||
# Code getting the name of the current branch. For master we want to publish as we did until now
|
# Code getting the name of the current branch. For master we want to publish as we did until now
|
||||||
# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
|
# https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
|
||||||
# If there is a branch already passed will reuse it - otherwise will try to find it
|
# If there is a branch already passed will reuse it - otherwise will try to find it
|
||||||
CURRENT_BRANCH=${BRANCH}
|
CURRENT_BRANCH=${BRANCH}
|
||||||
if [[ -z "${CURRENT_BRANCH}" ]] ; then
|
if [[ -z "${CURRENT_BRANCH}" ]] ; then
|
||||||
@@ -147,7 +147,7 @@ function copy_docs_for_current_version() {
|
|||||||
COMMIT_CHANGES="yes"
|
COMMIT_CHANGES="yes"
|
||||||
else
|
else
|
||||||
echo -e "Current branch is [${CURRENT_BRANCH}]"
|
echo -e "Current branch is [${CURRENT_BRANCH}]"
|
||||||
# http://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
|
# https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
|
||||||
if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
|
if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
|
||||||
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
|
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
|
||||||
echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
|
echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ are configured, they default per the user's profile in Cloud Foundry.
|
|||||||
|
|
||||||
NOTE: All of the OAuth2 SSO and resource server features moved to Spring Boot
|
NOTE: All of the OAuth2 SSO and resource server features moved to Spring Boot
|
||||||
in version 1.3. You can find documentation in the
|
in version 1.3. You can find documentation in the
|
||||||
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/[Spring Boot user guide].
|
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/[Spring Boot user guide].
|
||||||
|
|
||||||
This project provides automatic binding from CloudFoundry service
|
This project provides automatic binding from CloudFoundry service
|
||||||
credentials to the Spring Boot features. If you have a CloudFoundry
|
credentials to the Spring Boot features. If you have a CloudFoundry
|
||||||
|
|||||||
2
mvnw
vendored
2
mvnw
vendored
@@ -8,7 +8,7 @@
|
|||||||
# "License"); you may not use this file except in compliance
|
# "License"); you may not use this file except in compliance
|
||||||
# with the License. You may obtain a copy of the License at
|
# with the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing,
|
# Unless required by applicable law or agreed to in writing,
|
||||||
# software distributed under the License is distributed on an
|
# software distributed under the License is distributed on an
|
||||||
|
|||||||
2
mvnw.cmd
vendored
2
mvnw.cmd
vendored
@@ -7,7 +7,7 @@
|
|||||||
@REM "License"); you may not use this file except in compliance
|
@REM "License"); you may not use this file except in compliance
|
||||||
@REM with the License. You may obtain a copy of the License at
|
@REM with the License. You may obtain a copy of the License at
|
||||||
@REM
|
@REM
|
||||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@REM
|
@REM
|
||||||
@REM Unless required by applicable law or agreed to in writing,
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
@REM software distributed under the License is distributed on an
|
@REM software distributed under the License is distributed on an
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class CloudFoundryDiscoveryClientTest {
|
|||||||
ApplicationDetail applicationDetail = ApplicationDetail.builder().instances(2)
|
ApplicationDetail applicationDetail = ApplicationDetail.builder().instances(2)
|
||||||
.name("my-app").stack("stack").memoryLimit(1024).id("id")
|
.name("my-app").stack("stack").memoryLimit(1024).id("id")
|
||||||
.requestedState("requestedState").runningInstances(2)
|
.requestedState("requestedState").runningInstances(2)
|
||||||
.url("http://my-app.cfapps.io").diskQuota(20).build();
|
.url("http://my-app-cfapps-io").diskQuota(20).build();
|
||||||
InstanceDetail instanceDetail = InstanceDetail.builder().index("0").build();
|
InstanceDetail instanceDetail = InstanceDetail.builder().index("0").build();
|
||||||
Tuple2<ApplicationDetail, InstanceDetail> tuple2 = Tuples.of(applicationDetail,
|
Tuple2<ApplicationDetail, InstanceDetail> tuple2 = Tuples.of(applicationDetail,
|
||||||
instanceDetail);
|
instanceDetail);
|
||||||
|
|||||||
@@ -72,56 +72,56 @@ public class VcapServiceCredentialsEnvironmentPostProcessorTests {
|
|||||||
@Test
|
@Test
|
||||||
public void addTokenUri() {
|
public void addTokenUri() {
|
||||||
TestPropertyValues
|
TestPropertyValues
|
||||||
.of("vcap.services.sso.credentials.accessTokenUri:http://example.com")
|
.of("vcap.services.sso.credentials.accessTokenUri:http://exampledomain")
|
||||||
.applyTo(this.environment);
|
.applyTo(this.environment);
|
||||||
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
||||||
assertThat(this.environment
|
assertThat(this.environment
|
||||||
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
||||||
.isEqualTo("http://example.com");
|
.isEqualTo("http://exampledomain");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addTokenUriAuthDomain() {
|
public void addTokenUriAuthDomain() {
|
||||||
TestPropertyValues
|
TestPropertyValues
|
||||||
.of("vcap.services.sso.credentials.auth-domain:http://example.com")
|
.of("vcap.services.sso.credentials.auth-domain:http://exampledomain")
|
||||||
.applyTo(this.environment);
|
.applyTo(this.environment);
|
||||||
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
||||||
assertThat(this.environment
|
assertThat(this.environment
|
||||||
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
||||||
.isEqualTo("http://example.com/oauth/token");
|
.isEqualTo("http://exampledomain/oauth/token");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addUserInfoUri() {
|
public void addUserInfoUri() {
|
||||||
TestPropertyValues
|
TestPropertyValues
|
||||||
.of("vcap.services.sso.credentials.userInfoUri:http://example.com")
|
.of("vcap.services.sso.credentials.userInfoUri:http://exampledomain")
|
||||||
.applyTo(this.environment);
|
.applyTo(this.environment);
|
||||||
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
||||||
assertThat(this.environment
|
assertThat(this.environment
|
||||||
.resolvePlaceholders("${security.oauth2.resource.user-info-uri}"))
|
.resolvePlaceholders("${security.oauth2.resource.user-info-uri}"))
|
||||||
.isEqualTo("http://example.com");
|
.isEqualTo("http://exampledomain");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addServiceId() {
|
public void addServiceId() {
|
||||||
TestPropertyValues
|
TestPropertyValues
|
||||||
.of("vcap.services.my.credentials.accessTokenUri:http://example.com",
|
.of("vcap.services.my.credentials.accessTokenUri:http://exampledomain",
|
||||||
"security.oauth2.sso.serviceId:my")
|
"security.oauth2.sso.serviceId:my")
|
||||||
.applyTo(this.environment);
|
.applyTo(this.environment);
|
||||||
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
||||||
assertThat(this.environment
|
assertThat(this.environment
|
||||||
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
.resolvePlaceholders("${security.oauth2.client.access-token-uri}"))
|
||||||
.isEqualTo("http://example.com");
|
.isEqualTo("http://exampledomain");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addJwtKeyUri() {
|
public void addJwtKeyUri() {
|
||||||
TestPropertyValues.of("vcap.services.sso.credentials.keyUri:http://example.com")
|
TestPropertyValues.of("vcap.services.sso.credentials.keyUri:http://exampledomain")
|
||||||
.applyTo(this.environment);
|
.applyTo(this.environment);
|
||||||
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
|
||||||
assertThat(this.environment
|
assertThat(this.environment
|
||||||
.resolvePlaceholders("${security.oauth2.resource.jwt.key-uri}"))
|
.resolvePlaceholders("${security.oauth2.resource.jwt.key-uri}"))
|
||||||
.isEqualTo("http://example.com");
|
.isEqualTo("http://exampledomain");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user