Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAVA-24210 Fix oauth-client-spring startup issues(spring-security-oauth) #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = { ClientSpringApp.class })
public class ClientContextIntegrationTest {
class ClientContextIntegrationTest {

@Test
public void whenLoadApplication_thenSuccess() {
void whenLoadApplication_thenSuccess() {

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.baeldung.client;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.startsWith;

Expand Down Expand Up @@ -102,7 +103,7 @@ public void beforeEach() throws Exception {
}

@Test
public void givenAuthServerAndResourceServer_whenPerformClientLoginProcess_thenProcessExecutesOk() throws Exception {
void givenAuthServerAndResourceServer_whenPerformClientLoginProcess_thenProcessExecutesOk() throws Exception {
// mimic login button action
ExchangeResult result = this.webTestClient.get()
.uri(CLIENT_SECURED_URL)
Expand Down Expand Up @@ -165,7 +166,7 @@ public void givenAuthServerAndResourceServer_whenPerformClientLoginProcess_thenP
.expectStatus()
.isFound()
.expectHeader()
.value(HttpHeaders.LOCATION, endsWith(CLIENT_SECURED_URL))
.value(HttpHeaders.LOCATION, containsString(CLIENT_SECURED_URL))
.returnResult(Void.class);

// assert that Access Token Endpoint was requested as expected
Expand Down
36 changes: 36 additions & 0 deletions oauth-rest/oauth-client-spring/src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
spring:
security:
oauth2:
client:
registration:
custom:
client-id: newClient
client-secret: newClientSecret
scope: read,write
authorization-grant-type: authorization_code
redirect-uri: http://localhost:8082/oauth-client-spring/login/oauth2/code/custom
provider:
custom:
authorization-uri: http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/auth
token-uri: http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/token
user-info-uri: http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/userinfo
user-name-attribute: preferred_username
thymeleaf:
cache: false
devtools:
livereload:
port: 35729

server:
port: 8082
servlet:
context-path: /oauth-client-spring

logging:
level:
org.springframework: INFO

resourceserver:
api:
foo:
url: http://localhost:8081/resource-server/api/foos/
1 change: 0 additions & 1 deletion oauth-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<module>oauth-ui-authorization-code-angular</module>
<module>oauth-ui-authorization-code-angular-zuul</module>
<module>oauth-client-spring</module>
<module>keycloak-custom-protocol-mapper</module>
</modules>

</project>