Permalink
Browse files

Removing unnecessary null stubbing

  • Loading branch information...
garcia-jj committed Sep 19, 2012
1 parent 9a6d1e0 commit 5a49b782c5c06c642bf5e120391809f69766bfc9
@@ -87,9 +87,6 @@
public void initContainer() {
servletContext = mock(ServletContext.class);
- when(servletContext.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT"))
- .thenReturn(null);
-
when(servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME))
.thenReturn("br.com.caelum.vraptor.ioc.spring");
@@ -84,9 +84,6 @@ public T call() throws Exception {
@Override
protected void configureExpectations() {
- when(context.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT"))
- .thenReturn(null);
-
when(context.getRealPath(anyString()))
.thenReturn(SpringBasedContainer.class.getResource("../fixture").getFile());
@@ -72,8 +72,6 @@ public void destroy() {
@Test
public void shouldIncludeTheApplicationContextOnTheRootApplicationContextParamIfNotSet() throws Exception {
when(servletContext.getAttributeNames()).thenReturn(enumeration(Collections.<String> emptyList()));
- when(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
- .thenReturn(null);
defaultExpectations();

0 comments on commit 5a49b78

Please sign in to comment.