Move common TestPrincipal to spring-core test fixtures

See gh-23550
This commit is contained in:
Sam Brannen
2019-12-29 18:20:14 +01:00
parent 726b1bb1d0
commit 94f8ef08e2
16 changed files with 28 additions and 164 deletions

View File

@@ -79,6 +79,7 @@ import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.MethodParameter;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.testfixture.io.SerializationTestUtils;
import org.springframework.core.testfixture.security.TestPrincipal;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
@@ -2643,7 +2644,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
@ModelAttribute
public Principal getPrincipal() {
return new TestPrincipal();
return new TestPrincipal("test");
}
@RequestMapping("/myPath")
@@ -2661,14 +2662,6 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
}
}
static class TestPrincipal implements Principal {
@Override
public String getName() {
return "test";
}
}
static class OtherPrincipal implements Principal {
@Override