1 package org.mockito.internal.configuration; 2 3 import org.junit.Test; 4 import org.mockito.invocation.InvocationOnMock; 5 import org.mockito.stubbing.Answer; 6 import org.mockitousage.IMethods; 7 import org.mockitoutil.TestBase; 8 9 import static org.junit.Assert.assertEquals; 10 import static org.mockito.Mockito.mock; 11 12 public class ClassPathLoaderTest extends TestBase { 13 14 @Test 15 public void shouldReadConfigurationClassFromClassPath() { 16 ConfigurationAccess.getConfig().overrideDefaultAnswer(new Answer<Object>() { 17 public Object answer(InvocationOnMock invocation) { 18 return "foo"; 19 }}); 20 21 IMethods mock = mock(IMethods.class); 22 assertEquals("foo", mock.simpleMethod()); 23 } 24 } 25