@ContextConfigurationで読込先の指定方法を理解することによって、共通のspring設定ファイルとイレギュラー的に使用するspring設定ファイルを明示的に分けることが出来ます。 classpath指定した場合の参照先@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="classpath:servlet-context-test.xml") public class ExampleServoceTest { @Autowired private ExampleServoce service; @Test public void testService() { String ret = service.find(""); assertEquals("test dao!!", ret
![テックノート – @ContextConfigurationでclasspathでファイル参照先を指定する](https://cdn-ak-scissors.b.st-hatena.com/image/square/984ba9898926878f59e585de0e5dd209d59a93d8/height=288;version=1;width=512/https%3A%2F%2Fi1.wp.com%2Fjavatechnology.net%2Fwp-content%2Fuploads%2Fspring.png%3Ffit%3D1000%252C300)