Browse Source
Remove test-jar artifacts from Maven projects and relocate classes. The majority of utilities now live in the `spring-boot-testsupport` module. This update will help us to deploy artifacts using the standard Maven deploy plugin in the future (which doesn't support the filtering of individual artifacts). Fixes gh-9493pull/9508/head
119 changed files with 769 additions and 591 deletions
@ -0,0 +1,82 @@
@@ -0,0 +1,82 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.servlet; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
import javax.servlet.ServletContext; |
||||
|
||||
import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter; |
||||
import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredServlet; |
||||
import org.springframework.boot.web.server.WebServer; |
||||
import org.springframework.boot.web.server.WebServerException; |
||||
import org.springframework.boot.web.servlet.ServletContextInitializer; |
||||
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory; |
||||
import org.springframework.boot.web.servlet.server.ServletWebServerFactory; |
||||
|
||||
import static org.mockito.Mockito.spy; |
||||
|
||||
/** |
||||
* Mock {@link ServletWebServerFactory}. |
||||
* |
||||
* @author Phillip Webb |
||||
* @author Andy Wilkinson |
||||
*/ |
||||
public class MockServletWebServerFactory extends AbstractServletWebServerFactory { |
||||
|
||||
private MockServletWebServer webServer; |
||||
|
||||
@Override |
||||
public WebServer getWebServer(ServletContextInitializer... initializers) { |
||||
this.webServer = spy( |
||||
new MockServletWebServer(mergeInitializers(initializers), getPort())); |
||||
return this.webServer; |
||||
} |
||||
|
||||
public MockServletWebServer getWebServer() { |
||||
return this.webServer; |
||||
} |
||||
|
||||
public ServletContext getServletContext() { |
||||
return getWebServer() == null ? null : getWebServer().getServletContext(); |
||||
} |
||||
|
||||
public RegisteredServlet getRegisteredServlet(int index) { |
||||
return getWebServer() == null ? null : getWebServer().getRegisteredServlet(index); |
||||
} |
||||
|
||||
public RegisteredFilter getRegisteredFilter(int index) { |
||||
return getWebServer() == null ? null : getWebServer().getRegisteredFilters(index); |
||||
} |
||||
|
||||
public static class MockServletWebServer |
||||
extends org.springframework.boot.testsupport.web.servlet.MockServletWebServer |
||||
implements WebServer { |
||||
|
||||
public MockServletWebServer(ServletContextInitializer[] initializers, int port) { |
||||
super(Arrays.stream(initializers) |
||||
.map((i) -> (Initializer) (s) -> i.onStartup(s)) |
||||
.toArray(Initializer[]::new), port); |
||||
} |
||||
|
||||
@Override |
||||
public void start() throws WebServerException { |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<Configuration status="warn" name="test" packages=""> |
||||
<Properties> |
||||
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property> |
||||
<Property name="LOG_LEVEL_PATTERN">%5p</Property> |
||||
</Properties> |
||||
<Appenders> |
||||
<Console name="STDOUT" target="SYSTEM_OUT" follow="true"> |
||||
<PatternLayout pattern="%clr{%d{yyyy-MM-dd HH:mm:ss.SSS}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{${sys:PID}}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}"/> |
||||
</Console> |
||||
</Appenders> |
||||
<Loggers> |
||||
<Root level="info"> |
||||
<AppenderRef ref="STDOUT"/> |
||||
</Root> |
||||
</Loggers> |
||||
</Configuration> |
||||
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<configuration> |
||||
<include resource="org/springframework/boot/logging/logback/base.xml" /> |
||||
<root level="INFO"> |
||||
<appender-ref ref="CONSOLE" /> |
||||
</root> |
||||
<!-- logger name="org.springframework.security" level="DEBUG"/--> |
||||
</configuration> |
||||
@ -0,0 +1,82 @@
@@ -0,0 +1,82 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.autoconfigure.web.servlet; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
import javax.servlet.ServletContext; |
||||
|
||||
import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter; |
||||
import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredServlet; |
||||
import org.springframework.boot.web.server.WebServer; |
||||
import org.springframework.boot.web.server.WebServerException; |
||||
import org.springframework.boot.web.servlet.ServletContextInitializer; |
||||
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory; |
||||
import org.springframework.boot.web.servlet.server.ServletWebServerFactory; |
||||
|
||||
import static org.mockito.Mockito.spy; |
||||
|
||||
/** |
||||
* Mock {@link ServletWebServerFactory}. |
||||
* |
||||
* @author Phillip Webb |
||||
* @author Andy Wilkinson |
||||
*/ |
||||
public class MockServletWebServerFactory extends AbstractServletWebServerFactory { |
||||
|
||||
private MockServletWebServer webServer; |
||||
|
||||
@Override |
||||
public WebServer getWebServer(ServletContextInitializer... initializers) { |
||||
this.webServer = spy( |
||||
new MockServletWebServer(mergeInitializers(initializers), getPort())); |
||||
return this.webServer; |
||||
} |
||||
|
||||
public MockServletWebServer getWebServer() { |
||||
return this.webServer; |
||||
} |
||||
|
||||
public ServletContext getServletContext() { |
||||
return getWebServer() == null ? null : getWebServer().getServletContext(); |
||||
} |
||||
|
||||
public RegisteredServlet getRegisteredServlet(int index) { |
||||
return getWebServer() == null ? null : getWebServer().getRegisteredServlet(index); |
||||
} |
||||
|
||||
public RegisteredFilter getRegisteredFilter(int index) { |
||||
return getWebServer() == null ? null : getWebServer().getRegisteredFilters(index); |
||||
} |
||||
|
||||
public static class MockServletWebServer |
||||
extends org.springframework.boot.testsupport.web.servlet.MockServletWebServer |
||||
implements WebServer { |
||||
|
||||
public MockServletWebServer(ServletContextInitializer[] initializers, int port) { |
||||
super(Arrays.stream(initializers) |
||||
.map((i) -> (Initializer) (s) -> i.onStartup(s)) |
||||
.toArray(Initializer[]::new), port); |
||||
} |
||||
|
||||
@Override |
||||
public void start() throws WebServerException { |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -1,128 +0,0 @@
@@ -1,128 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2016 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.loader; |
||||
|
||||
import java.io.ByteArrayOutputStream; |
||||
import java.io.IOException; |
||||
import java.io.OutputStream; |
||||
import java.io.PrintStream; |
||||
|
||||
import org.junit.rules.TestRule; |
||||
import org.junit.runner.Description; |
||||
import org.junit.runners.model.Statement; |
||||
|
||||
/** |
||||
* Internal JUnit {@code @Rule} to capture output from System.out and System.err. |
||||
* |
||||
* @author Phillip Webb |
||||
*/ |
||||
class InternalOutputCapture implements TestRule { |
||||
|
||||
private CaptureOutputStream captureOut; |
||||
|
||||
private CaptureOutputStream captureErr; |
||||
|
||||
private ByteArrayOutputStream copy; |
||||
|
||||
@Override |
||||
public Statement apply(final Statement base, Description description) { |
||||
return new Statement() { |
||||
@Override |
||||
public void evaluate() throws Throwable { |
||||
captureOutput(); |
||||
try { |
||||
base.evaluate(); |
||||
} |
||||
finally { |
||||
releaseOutput(); |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
|
||||
protected void captureOutput() { |
||||
this.copy = new ByteArrayOutputStream(); |
||||
this.captureOut = new CaptureOutputStream(System.out, this.copy); |
||||
this.captureErr = new CaptureOutputStream(System.err, this.copy); |
||||
System.setOut(new PrintStream(this.captureOut)); |
||||
System.setErr(new PrintStream(this.captureErr)); |
||||
} |
||||
|
||||
protected void releaseOutput() { |
||||
System.setOut(this.captureOut.getOriginal()); |
||||
System.setErr(this.captureErr.getOriginal()); |
||||
this.copy = null; |
||||
} |
||||
|
||||
public void flush() { |
||||
try { |
||||
this.captureOut.flush(); |
||||
this.captureErr.flush(); |
||||
} |
||||
catch (IOException ex) { |
||||
// ignore
|
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
flush(); |
||||
return this.copy.toString(); |
||||
} |
||||
|
||||
private static class CaptureOutputStream extends OutputStream { |
||||
|
||||
private final PrintStream original; |
||||
|
||||
private final OutputStream copy; |
||||
|
||||
CaptureOutputStream(PrintStream original, OutputStream copy) { |
||||
this.original = original; |
||||
this.copy = copy; |
||||
} |
||||
|
||||
@Override |
||||
public void write(int b) throws IOException { |
||||
this.copy.write(b); |
||||
this.original.write(b); |
||||
this.original.flush(); |
||||
} |
||||
|
||||
@Override |
||||
public void write(byte[] b) throws IOException { |
||||
write(b, 0, b.length); |
||||
} |
||||
|
||||
@Override |
||||
public void write(byte[] b, int off, int len) throws IOException { |
||||
this.copy.write(b, off, len); |
||||
this.original.write(b, off, len); |
||||
} |
||||
|
||||
public PrintStream getOriginal() { |
||||
return this.original; |
||||
} |
||||
|
||||
@Override |
||||
public void flush() throws IOException { |
||||
this.copy.flush(); |
||||
this.original.flush(); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
/** |
||||
* Utilities and helpers for AssertJ. |
||||
*/ |
||||
package org.springframework.boot.testsupport.assertj; |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
/** |
||||
* Utilities to help test Spring contexts. |
||||
*/ |
||||
package org.springframework.boot.testsupport.context; |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
/** |
||||
* Internal support classes used in Spring Boot tests. |
||||
*/ |
||||
package org.springframework.boot.testsupport; |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
/** |
||||
* Internal JUnit rules used in Spring Boot tests. |
||||
*/ |
||||
package org.springframework.boot.testsupport.rule; |
||||
@ -0,0 +1,245 @@
@@ -0,0 +1,245 @@
|
||||
/* |
||||
* Copyright 2012-2017 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.testsupport.web.servlet; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Collections; |
||||
import java.util.Enumeration; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.NoSuchElementException; |
||||
|
||||
import javax.servlet.Filter; |
||||
import javax.servlet.FilterRegistration; |
||||
import javax.servlet.RequestDispatcher; |
||||
import javax.servlet.Servlet; |
||||
import javax.servlet.ServletContext; |
||||
import javax.servlet.ServletException; |
||||
import javax.servlet.ServletRegistration; |
||||
|
||||
import org.mockito.invocation.InvocationOnMock; |
||||
import org.mockito.stubbing.Answer; |
||||
|
||||
import static org.mockito.ArgumentMatchers.any; |
||||
import static org.mockito.ArgumentMatchers.anyString; |
||||
import static org.mockito.BDDMockito.given; |
||||
import static org.mockito.Mockito.mock; |
||||
|
||||
/** |
||||
* Base class for Mock {@code ServletWebServer} implementations. Reduces the amount of |
||||
* code that would otherwise be duplicated in {@code spring-boot}, |
||||
* {@code spring-boot-autoconfigure} and {@code spring-boot-actuator}. |
||||
* |
||||
* @author Phillip Webb |
||||
* @author Andy Wilkinson |
||||
*/ |
||||
public abstract class MockServletWebServer { |
||||
|
||||
private ServletContext servletContext; |
||||
|
||||
private final Initializer[] initializers; |
||||
|
||||
private final List<RegisteredServlet> registeredServlets = new ArrayList<>(); |
||||
|
||||
private final List<RegisteredFilter> registeredFilters = new ArrayList<>(); |
||||
|
||||
private final int port; |
||||
|
||||
public MockServletWebServer(Initializer[] initializers, int port) { |
||||
this.initializers = initializers; |
||||
this.port = port; |
||||
initialize(); |
||||
} |
||||
|
||||
private void initialize() { |
||||
try { |
||||
this.servletContext = mock(ServletContext.class); |
||||
given(this.servletContext.addServlet(anyString(), (Servlet) any())) |
||||
.willAnswer(new Answer<ServletRegistration.Dynamic>() { |
||||
@Override |
||||
public ServletRegistration.Dynamic answer( |
||||
InvocationOnMock invocation) throws Throwable { |
||||
RegisteredServlet registeredServlet = new RegisteredServlet( |
||||
(Servlet) invocation.getArguments()[1]); |
||||
MockServletWebServer.this.registeredServlets |
||||
.add(registeredServlet); |
||||
return registeredServlet.getRegistration(); |
||||
} |
||||
}); |
||||
given(this.servletContext.addFilter(anyString(), (Filter) any())) |
||||
.willAnswer(new Answer<FilterRegistration.Dynamic>() { |
||||
@Override |
||||
public FilterRegistration.Dynamic answer( |
||||
InvocationOnMock invocation) throws Throwable { |
||||
RegisteredFilter registeredFilter = new RegisteredFilter( |
||||
(Filter) invocation.getArguments()[1]); |
||||
MockServletWebServer.this.registeredFilters |
||||
.add(registeredFilter); |
||||
return registeredFilter.getRegistration(); |
||||
} |
||||
}); |
||||
final Map<String, String> initParameters = new HashMap<>(); |
||||
given(this.servletContext.setInitParameter(anyString(), anyString())) |
||||
.will(new Answer<Void>() { |
||||
@Override |
||||
public Void answer(InvocationOnMock invocation) throws Throwable { |
||||
initParameters.put(invocation.getArgument(0), |
||||
invocation.getArgument(1)); |
||||
return null; |
||||
} |
||||
|
||||
}); |
||||
given(this.servletContext.getInitParameterNames()) |
||||
.willReturn(Collections.enumeration(initParameters.keySet())); |
||||
given(this.servletContext.getInitParameter(anyString())) |
||||
.willAnswer(new Answer<String>() { |
||||
@Override |
||||
public String answer(InvocationOnMock invocation) |
||||
throws Throwable { |
||||
return initParameters.get(invocation.getArgument(0)); |
||||
} |
||||
}); |
||||
given(this.servletContext.getAttributeNames()) |
||||
.willReturn(MockServletWebServer.<String>emptyEnumeration()); |
||||
given(this.servletContext.getNamedDispatcher("default")) |
||||
.willReturn(mock(RequestDispatcher.class)); |
||||
for (Initializer initializer : this.initializers) { |
||||
initializer.onStartup(this.servletContext); |
||||
} |
||||
} |
||||
catch (ServletException ex) { |
||||
throw new RuntimeException(ex); |
||||
} |
||||
} |
||||
|
||||
public void stop() { |
||||
this.servletContext = null; |
||||
this.registeredServlets.clear(); |
||||
} |
||||
|
||||
public ServletContext getServletContext() { |
||||
return this.servletContext; |
||||
} |
||||
|
||||
public Servlet[] getServlets() { |
||||
Servlet[] servlets = new Servlet[this.registeredServlets.size()]; |
||||
for (int i = 0; i < servlets.length; i++) { |
||||
servlets[i] = this.registeredServlets.get(i).getServlet(); |
||||
} |
||||
return servlets; |
||||
} |
||||
|
||||
public RegisteredServlet getRegisteredServlet(int index) { |
||||
return getRegisteredServlets().get(index); |
||||
} |
||||
|
||||
public List<RegisteredServlet> getRegisteredServlets() { |
||||
return this.registeredServlets; |
||||
} |
||||
|
||||
public RegisteredFilter getRegisteredFilters(int index) { |
||||
return getRegisteredFilters().get(index); |
||||
} |
||||
|
||||
public List<RegisteredFilter> getRegisteredFilters() { |
||||
return this.registeredFilters; |
||||
} |
||||
|
||||
public int getPort() { |
||||
return this.port; |
||||
} |
||||
|
||||
@SuppressWarnings("unchecked") |
||||
public static <T> Enumeration<T> emptyEnumeration() { |
||||
return (Enumeration<T>) EmptyEnumeration.EMPTY_ENUMERATION; |
||||
} |
||||
|
||||
private static class EmptyEnumeration<E> implements Enumeration<E> { |
||||
|
||||
static final MockServletWebServer.EmptyEnumeration<Object> EMPTY_ENUMERATION = new MockServletWebServer.EmptyEnumeration<>(); |
||||
|
||||
@Override |
||||
public boolean hasMoreElements() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public E nextElement() { |
||||
throw new NoSuchElementException(); |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* A registered servlet. |
||||
*/ |
||||
public static class RegisteredServlet { |
||||
|
||||
private final Servlet servlet; |
||||
|
||||
private final ServletRegistration.Dynamic registration; |
||||
|
||||
public RegisteredServlet(Servlet servlet) { |
||||
this.servlet = servlet; |
||||
this.registration = mock(ServletRegistration.Dynamic.class); |
||||
} |
||||
|
||||
public ServletRegistration.Dynamic getRegistration() { |
||||
return this.registration; |
||||
} |
||||
|
||||
public Servlet getServlet() { |
||||
return this.servlet; |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* A registered filter. |
||||
*/ |
||||
public static class RegisteredFilter { |
||||
|
||||
private final Filter filter; |
||||
|
||||
private final FilterRegistration.Dynamic registration; |
||||
|
||||
public RegisteredFilter(Filter filter) { |
||||
this.filter = filter; |
||||
this.registration = mock(FilterRegistration.Dynamic.class); |
||||
} |
||||
|
||||
public FilterRegistration.Dynamic getRegistration() { |
||||
return this.registration; |
||||
} |
||||
|
||||
public Filter getFilter() { |
||||
return this.filter; |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Initializer (usually implement by adapting {@code Initializer}). |
||||
*/ |
||||
protected interface Initializer { |
||||
|
||||
void onStartup(ServletContext context) throws ServletException; |
||||
|
||||
} |
||||
|
||||
} |
||||
2
spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/junit/runner/classpath/ModifiedClassPathRunnerExclusionsTests.java → spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunnerExclusionsTests.java
2
spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/junit/runner/classpath/ModifiedClassPathRunnerExclusionsTests.java → spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunnerExclusionsTests.java
2
spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/junit/runner/classpath/ModifiedClassPathRunnerOverridesTests.java → spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunnerOverridesTests.java
2
spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/junit/runner/classpath/ModifiedClassPathRunnerOverridesTests.java → spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunnerOverridesTests.java
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue