Move ApplicationContextTestUtils to src/test

Move ApplicationContextTestUtils from src/main to src/test since it
is probably of limited use to others.

Fixes gh-1034
pull/1118/merge
Phillip Webb 11 years ago
parent 25eb6fb81a
commit 8a1279315e

@ -22,7 +22,6 @@ import java.util.Collections;
import org.junit.After; import org.junit.After;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.test.ApplicationContextTestUtils; import org.springframework.boot.test.ApplicationContextTestUtils;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ApplicationContextInitializer;

@ -16,21 +16,18 @@
package org.springframework.boot.test; package org.springframework.boot.test;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
/** /**
* Application context related test utilities. * Internal application context related test utilities.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 1.1.1
*/ */
public abstract class ApplicationContextTestUtils { public abstract class ApplicationContextTestUtils {
/** /**
* Closes this {@link ApplicationContext} and its parent hierarchy * Closes this {@link ApplicationContext} and its parent hierarchy if any.
* if any.
* @param context the context to close (can be {@code null}) * @param context the context to close (can be {@code null})
*/ */
public static void closeAll(ApplicationContext context) { public static void closeAll(ApplicationContext context) {

@ -16,15 +16,16 @@
package org.springframework.boot.test; package org.springframework.boot.test;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.*;
import org.junit.Test; import org.junit.Test;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/** /**
* Tests for {@link ApplicationContextTestUtils}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
@ -32,7 +33,7 @@ public class ApplicationContextTestUtilsTests {
@Test @Test
public void closeNull() { public void closeNull() {
ApplicationContextTestUtils.closeAll(null); ApplicationContextTestUtils.closeAll(null);
} }
@Test @Test
@ -47,7 +48,6 @@ public class ApplicationContextTestUtilsTests {
ConfigurableApplicationContext parent = mock(ConfigurableApplicationContext.class); ConfigurableApplicationContext parent = mock(ConfigurableApplicationContext.class);
given(mock.getParent()).willReturn(parent); given(mock.getParent()).willReturn(parent);
given(parent.getParent()).willReturn(null); given(parent.getParent()).willReturn(null);
ApplicationContextTestUtils.closeAll(mock); ApplicationContextTestUtils.closeAll(mock);
verify(mock).getParent(); verify(mock).getParent();
verify(mock).close(); verify(mock).close();

Loading…
Cancel
Save