Ver Fonte

Remove MockitoJUnitRunner from JSON tests

Previously the JSON tests unnecessarily had MockitoJUnitRunner.

This commit removes MockitoJUnitRunner from the JSON tests.

Issue gh-3736
Rob Winch há 9 anos atrás
pai
commit
d4c48dd3e1

+ 0 - 3
cas/src/test/java/org/springframework/security/cas/jackson2/CasAuthenticationTokenMixinTests.java

@@ -28,8 +28,6 @@ import org.jasig.cas.client.validation.Assertion;
 import org.jasig.cas.client.validation.AssertionImpl;
 import org.json.JSONException;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.skyscreamer.jsonassert.JSONAssert;
 
 import org.springframework.security.cas.authentication.CasAuthenticationToken;
@@ -45,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat;
  * @author Jitendra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public class CasAuthenticationTokenMixinTests {
 
 	private final String KEY = "casKey";

+ 0 - 3
core/src/test/java/org/springframework/security/jackson2/AbstractMixinTests.java

@@ -17,8 +17,6 @@
 package org.springframework.security.jackson2;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.util.ObjectUtils;
@@ -29,7 +27,6 @@ import java.util.Collections;
  * @author Jitenra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public abstract class AbstractMixinTests {
 
 	ObjectMapper mapper;

+ 1 - 3
web/src/test/java/org/springframework/security/web/jackson2/AbstractMixinTests.java

@@ -17,8 +17,7 @@
 package org.springframework.security.web.jackson2;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+
 import org.springframework.security.jackson2.SecurityJacksonModules;
 import org.springframework.util.ObjectUtils;
 
@@ -26,7 +25,6 @@ import org.springframework.util.ObjectUtils;
  * @author Jitenra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public abstract class AbstractMixinTests {
 
 	ObjectMapper mapper;

+ 3 - 5
web/src/test/java/org/springframework/security/web/jackson2/DefaultCsrfTokenMixinTests.java

@@ -16,27 +16,25 @@
 
 package org.springframework.security.web.jackson2;
 
+import java.io.IOException;
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.json.JSONException;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.skyscreamer.jsonassert.JSONAssert;
+
 import org.springframework.security.jackson2.SecurityJacksonModules;
 import org.springframework.security.web.csrf.DefaultCsrfToken;
 
-import java.io.IOException;
-
 import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * @author Jitendra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public class DefaultCsrfTokenMixinTests {
 
 	ObjectMapper objectMapper;

+ 1 - 3
web/src/test/java/org/springframework/security/web/jackson2/DefaultSavedRequestMixinTests.java

@@ -18,9 +18,8 @@ package org.springframework.security.web.jackson2;
 
 import org.json.JSONException;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.skyscreamer.jsonassert.JSONAssert;
+
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.security.web.PortResolverImpl;
 import org.springframework.security.web.savedrequest.DefaultSavedRequest;
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
  * @author Jitendra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public class DefaultSavedRequestMixinTests extends AbstractMixinTests {
 
 	String defaultSavedRequestJson = "{" +

+ 0 - 3
web/src/test/java/org/springframework/security/web/jackson2/WebAuthenticationDetailsMixinTests.java

@@ -23,8 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import org.json.JSONException;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.skyscreamer.jsonassert.JSONAssert;
 
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -38,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
  * @author Jitendra Singh
  * @since 4.2
  */
-@RunWith(MockitoJUnitRunner.class)
 public class WebAuthenticationDetailsMixinTests {
 
 	ObjectMapper mapper;