diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java index a3fc1d4034..5ee098f1f1 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java @@ -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 map = new LinkedHashMap(); + @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(this.map, HttpStatus.OK)); + given(this.template.getForEntity(any(String.class), eq(Map.class))).willReturn( + new ResponseEntity(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 .emptyMap())); this.expected.expect(InvalidTokenException.class);