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

Upgraded spring boot to 1.1.3.RELEASE #1

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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<artifactId>demo</artifactId>
<version>0.0.1.SNAPSHOT</version>

<name>error</name>
<name>Demo Project</name>
<description>Demo project</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
<version>1.1.3.RELEASE</version>
</parent>

<dependencies>
Expand All @@ -32,7 +32,7 @@
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
<version>2.0.1.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>jackson-mapper-asl</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/demo/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.OAuth2ResourceServerConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand Down Expand Up @@ -48,7 +48,7 @@ public void configure(HttpSecurity http) throws Exception {
}

@Override
public void configure(OAuth2ResourceServerConfigurer resources) throws Exception {
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
resources.resourceId("sparklr");
}

Expand All @@ -62,7 +62,7 @@ protected static class OAuth2Config extends AuthorizationServerConfigurerAdapter
private AuthenticationManager authenticationManager;

@Override
public void configure(OAuth2AuthorizationServerConfigurer oauthServer) throws Exception {
public void configure(AuthorizationServerEndpointsConfigurer oauthServer) throws Exception {
oauthServer.authenticationManager(authenticationManager);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ security:
user:
password: password

debug: true
debug: false
2 changes: 1 addition & 1 deletion src/test/java/demo/AuthorizationCodeProviderTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.common.exceptions.RedirectMismatchException;
import org.springframework.security.oauth2.common.util.OAuth2Utils;
import org.springframework.security.oauth2.provider.token.InMemoryTokenStore;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.util.LinkedMultiValueMap;
Expand Down
23 changes: 7 additions & 16 deletions src/test/java/demo/ServerRunning.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
package demo;

import java.net.HttpURLConnection;
import java.net.URI;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assume;
import org.junit.internal.AssumptionViolatedException;
import org.junit.rules.MethodRule;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
import org.springframework.boot.test.RestTemplates;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.http.*;
import org.springframework.security.oauth2.client.test.RestTemplateHolder;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriTemplate;

import java.net.HttpURLConnection;
import java.net.URI;
import java.util.*;

/**
* <p>
* A rule that prevents integration tests from failing if the server application is not running or not accessible. If
Expand Down Expand Up @@ -287,7 +278,7 @@ public RestOperations getRestTemplate() {
}

public RestOperations createRestTemplate() {
RestTemplate client = RestTemplates.get();
RestTemplate client = new TestRestTemplate();
return client;
}

Expand Down