org.springframework.mock.web.MockHttpServletRequest



API Populatity

15 Client projects

Project SpringSource/spring-security-oauth in file ...uth2ClientAuthenticationProcessingFilterTests.java (2014-08-28)
@@ -27,6 +27,7 @@ import javax.servlet.ServletException;
 
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.oauth2.client.OAuth2RestOperations;
 import org.springframework.security.oauth2.client.http.AccessTokenRequiredException;
@@ -57,7 +58,7 @@ public class OAuth2ClientAuthenticationProcessingFilterTests {
 		OAuth2Request storedOAuth2Request = RequestTokenFactory.createOAuth2Request("client", false, scopes);
 		this.authentication = new OAuth2Authentication(storedOAuth2Request, null);
 		Mockito.when(tokenServices.loadAuthentication("FOO")).thenReturn(authentication);
-		Authentication authentication = filter.attemptAuthentication(null, null);
+		Authentication authentication = filter.attemptAuthentication(new MockHttpServletRequest(), null);
 		assertEquals(this.authentication, authentication);
 	}
 
Project spring-projects/spring-security-oauth in file ...uth2ClientAuthenticationProcessingFilterTests.java (2014-08-28)
@@ -27,6 +27,7 @@ import javax.servlet.ServletException;
 
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.oauth2.client.OAuth2RestOperations;
 import org.springframework.security.oauth2.client.http.AccessTokenRequiredException;
@@ -57,7 +58,7 @@ public class OAuth2ClientAuthenticationProcessingFilterTests {
 		OAuth2Request storedOAuth2Request = RequestTokenFactory.createOAuth2Request("client", false, scopes);
 		this.authentication = new OAuth2Authentication(storedOAuth2Request, null);
 		Mockito.when(tokenServices.loadAuthentication("FOO")).thenReturn(authentication);
-		Authentication authentication = filter.attemptAuthentication(null, null);
+		Authentication authentication = filter.attemptAuthentication(new MockHttpServletRequest(), null);
 		assertEquals(this.authentication, authentication);
 	}
 
Project spring-projects/spring-security in file ...work.security.openid.OpenID4JavaConsumerTests.java (2011-04-07)
@@ -32,7 +32,6 @@ import java.util.*;
 
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.mock.web.MockHttpServletRequest;
 
 /**
  * @author Luke Taylor
@@ -43,6 +42,7 @@ import org.springframework.mock.web.MockHttpServletRequest;
 public class OpenID4JavaConsumerTests {
     List<OpenIDAttribute> attributes = Arrays.asList(new OpenIDAttribute("a","b"), new OpenIDAttribute("b","b", Arrays.asList("c")));
 
+    @SuppressWarnings("deprecation")
     @Test
     public void beginConsumptionCreatesExpectedSessionData() throws Exception {
         ConsumerManager mgr = mock(ConsumerManager.class);
@@ -147,6 +147,7 @@ public class OpenID4JavaConsumerTests {
 
     }
 
+    @SuppressWarnings("serial")
     @Test
     public void successfulVerificationReturnsExpectedAuthentication() throws Exception {
         ConsumerManager mgr = mock(ConsumerManager.class);
@@ -202,6 +203,7 @@ public class OpenID4JavaConsumerTests {
     }
 
 
+    @SuppressWarnings("deprecation")
     @Test
     public void additionalConstructorsWork() throws Exception {
         new OpenID4JavaConsumer();