ComponentProxyObjectFactory { protected ApplicationContext createApplicationContext(String configFilePath) { return new FileSystemXmlApplicationContext(configFilePath); }    }
@Test public void testCreateApplicationContext() { try { final ApplicationContext mockContext = context.mock(ApplicationContext.class); ComponentProxyObjectFactory sut = new ComponentProxyObjectFactory() { @Override protected ApplicationContext createApplicationContext(String configFilePath) { return mockContext; } @Override protected String getConfigFileName() { return ""; } }; ApplicationContext appContext = sut.createApplicationContext(""); assertNotNull("ApplicationContext was null", appContext); } catch (Throwable t) { System.out.println("Error running testCreateApplicationContext test: " + t.getMessage()); t.printStackTrace(); fail("Error running testCreateApplicationContext test: " + t.getMessage()); } }