Commit a38f01f9 authored by Andy Wilkinson's avatar Andy Wilkinson

Fix compile errors in Eclipse (STS 3.6.4) in UserInfoTokenServicesTests

parent d10dd137
......@@ -36,6 +36,7 @@ import org.springframework.security.oauth2.common.exceptions.InvalidTokenExcepti
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
/**
......@@ -57,12 +58,12 @@ public class UserInfoTokenServicesTests {
private Map<String, Object> map = new LinkedHashMap<String, Object>();
@SuppressWarnings("rawtypes")
@Before
@SuppressWarnings({ "unchecked", "rawtypes" })
public void init() {
this.resource.setClientId("foo");
given(this.template.getForEntity(any(String.class), any(Class.class)))
.willReturn(new ResponseEntity<Map>(this.map, HttpStatus.OK));
given(this.template.getForEntity(any(String.class), eq(Map.class))).willReturn(
new ResponseEntity<Map>(this.map, HttpStatus.OK));
given(this.template.getAccessToken()).willReturn(
new DefaultOAuth2AccessToken("FOO"));
given(this.template.getResource()).willReturn(this.resource);
......@@ -76,11 +77,10 @@ public class UserInfoTokenServicesTests {
assertEquals("unknown", this.services.loadAuthentication("FOO").getName());
}
@SuppressWarnings("unchecked")
@Test
public void badToken() {
this.services.setRestTemplate(this.template);
given(this.template.getForEntity(any(String.class), any(Class.class))).willThrow(
given(this.template.getForEntity(any(String.class), eq(Map.class))).willThrow(
new UserRedirectRequiredException("foo:bar", Collections
.<String, String>emptyMap()));
this.expected.expect(InvalidTokenException.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment