|
|
@ -38,8 +38,8 @@ import org.mockito.stubbing.Answer;
|
|
|
|
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
|
|
|
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
|
|
|
|
|
|
|
import static org.mockito.ArgumentMatchers.anyString;
|
|
|
|
import static org.mockito.BDDMockito.given;
|
|
|
|
import static org.mockito.BDDMockito.given;
|
|
|
|
import static org.mockito.Matchers.anyString;
|
|
|
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
import static org.mockito.Mockito.spy;
|
|
|
|
import static org.mockito.Mockito.spy;
|
|
|
|
|
|
|
|
|
|
|
@ -132,8 +132,7 @@ public class MockEmbeddedServletContainerFactory
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Void answer(InvocationOnMock invocation)
|
|
|
|
public Void answer(InvocationOnMock invocation)
|
|
|
|
throws Throwable {
|
|
|
|
throws Throwable {
|
|
|
|
initParameters.put(
|
|
|
|
initParameters.put(invocation.getArgument(0),
|
|
|
|
invocation.getArgument(0),
|
|
|
|
|
|
|
|
invocation.getArgument(1));
|
|
|
|
invocation.getArgument(1));
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -146,8 +145,7 @@ public class MockEmbeddedServletContainerFactory
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String answer(InvocationOnMock invocation)
|
|
|
|
public String answer(InvocationOnMock invocation)
|
|
|
|
throws Throwable {
|
|
|
|
throws Throwable {
|
|
|
|
return initParameters
|
|
|
|
return initParameters.get(invocation.getArgument(0));
|
|
|
|
.get(invocation.getArgument(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
given(this.servletContext.getAttributeNames()).willReturn(
|
|
|
|
given(this.servletContext.getAttributeNames()).willReturn(
|
|
|
|