{"id":105,"date":"2017-10-09T20:52:34","date_gmt":"2017-10-09T11:52:34","guid":{"rendered":"http:\/\/ito-u-oti.com\/?p=105"},"modified":"2018-05-05T19:15:38","modified_gmt":"2018-05-05T10:15:38","slug":"post-105","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=105","title":{"rendered":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit)"},"content":{"rendered":"<h2 id=\"outline__1\">Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit)<\/h2>\n<div class=\"pointBox\">\u3010\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3011<br \/>\n<a href=\"http:\/\/terasolunaorg.github.io\/guideline\/5.3.0.RELEASE\/ja\/index.html\">TERASOLUNA Server Framework for Java (5.x) Development Guideline<\/a><br \/>\n<a href=\"http:\/\/terasolunaorg.github.io\/guideline\/5.3.0.RELEASE\/ja\/Tutorial\/TutorialTodo.html\">\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089<\/a><br \/>\n\uff08\u3053\u308c\u306eMyBatis3\u3092\u4f7f\u7528\u3057\u305f\u30d1\u30bf\u30fc\u30f3\u3067\u4f5c\u6210\u3057\u3066\u307e\u3059\u3002\uff09<\/div>\n<h2 id=\"outline__2\">1-3.Repository\u30c6\u30b9\u30c8\u3000Junit4,Spring-test,DBUnit\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u305f\u30d1\u30bf\u30fc\u30f3<\/h2>\n<p>\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u7c21\u5358\u306b\u3059\u308b\u305f\u3081\u306b\u3001DBUnit\u3092\u4f7f\u3063\u3066xml\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h3 id=\"outline__2_1\">\u3010pom.xml\u3011<\/h3>\n<p>DBUnit\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u305f\u3081\u306b\u8ffd\u52a0\u3057\u3066\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;junit&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;junit&lt;\/artifactId&gt;\r\n        &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-test&lt;\/artifactId&gt;\r\n        &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.dbunit&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;dbunit&lt;\/artifactId&gt;\r\n        &lt;version&gt;2.5.4&lt;\/version&gt;\r\n        &lt;scope&gt;test&lt;\/scope&gt;\r\n   &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;\r\n<\/pre>\n<h3 id=\"outline__2_2\">\u3010\u30c6\u30b9\u30c8\u5bfe\u8c61\u30af\u30e9\u30b9\u3011<\/h3>\n<p>TodoRepository.java<br \/>\n\u30c6\u30b9\u30c8\u5bfe\u8c61\u306fupdate\u30e1\u30bd\u30c3\u30c9<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic interface TodoRepository {\r\n   Todo findOne(String todoId);\r\n\r\n    Collection&lt;Todo&gt; findAll();\r\n\r\n    void create(Todo todo);\r\n\r\n    boolean update(Todo todo);\r\n\r\n    void delete(Todo todo);\r\n\r\n    long countByFinished(boolean finished);\r\n}\r\n<\/pre>\n<h3 id=\"outline__2_3\">\u3010\u30c6\u30b9\u30c8\u30af\u30e9\u30b9\u3011<\/h3>\n<p>TodoRepositoryTestVerDBunit.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@RunWith(SpringJUnit4ClassRunner.class)\r\n@ContextConfiguration(locations = {&quot;classpath:META-INF\/spring\/test-context-dbunit.xml&quot;})\r\n@Transactional\r\npublic class TodoRepositoryTestVerDBunit extends DataSourceBasedDBTestCase {\r\n\r\n    private final String RESOURCE_DIR = &quot;src\/test\/resources\/META-INF\/dbunit\/&quot;;\r\n    \r\n    @Inject\r\n    TodoRepository target;\r\n    \r\n    @Inject\r\n    JdbcTemplate jdbctemplate;\r\n    \r\n    @Inject\r\n    private TransactionAwareDataSourceProxy dataSourceTest;\r\n    \r\n    @Before\r\n    public void setUp() throws Exception {\r\n        super.setUp();\r\n        \r\n        \/* \u610f\u5473\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u3001\u3053\u3053\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u30d5\u30a1\u30a4\u30eb\u3068\uff24\uff22\u306e\u683c\u7d0d\u5f8c\u306e\u6574\u5408\u6027\u78ba\u8a8d\u304c\u3067\u304d\u308b\u3002\r\n        IDataSet databaseDataSet = getConnection().createDataSet();\r\n        ITable actualTable = databaseDataSet.getTable(&quot;todo&quot;);\r\n        IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(new File(RESOURCE_DIR + &quot;test_data.xml&quot;));\r\n        ITable expectedTable = expectedDataSet.getTable(&quot;todo&quot;);\r\n        Assertion.assertEquals(expectedTable, actualTable);\r\n        *\/\r\n        \r\n    }\r\n    \r\n    @Test\r\n    @Rollback\r\n    public void testUpdate() throws Exception {\r\n        \/\/\u30c6\u30b9\u30c8\u7528\u306e\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\uff08getTodoData\u30e1\u30bd\u30c3\u30c9\u306fDB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308bprivate\u30e1\u30bd\u30c3\u30c9\u3002\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u63db\u3048\u3066\u66f4\u65b0\u3059\u308b\u3002\uff09\r\n        String todoId = &quot;cceae402-c5b1-440f-bae2-7bee19dc17fb&quot;;\r\n        Todo testDataTodo = getTodoData(todoId);\r\n        testDataTodo.setFinished(true);\r\n        \r\n        \/\/update\u30e1\u30bd\u30c3\u30c9\u306e\u30c6\u30b9\u30c8\r\n        boolean actTodo = target.update(testDataTodo);\r\n\r\n        \/\/\u7d50\u679c\u691c\u8a3c\r\n        assertEquals(actTodo, true);\r\n        \r\n        \/\/\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u5f8c\u30c6\u30fc\u30d6\u30eb\u30c7\u30fc\u30bf\u691c\u8a3c\r\n        \/\/\u3053\u3053\u3067\u6307\u5b9a\u3057\u305fxml\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u5f8c\u306b\u66f4\u65b0\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u306e\u671f\u5f85\u5024\u3092\u8a18\u8ff0\u3057\u3066\u3044\u308b\r\n        Assertion.assertEquals(getexpectedTable(RESOURCE_DIR + &quot;compare_data.xml&quot;), getactualTable());\r\n        \r\n    }\r\n    \r\n    \/\/\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\r\n    private ITable getactualTable() throws Exception {\r\n        \r\n        IDataSet databaseDataSet = getConnection().createDataSet();\r\n        ITable actualTable = databaseDataSet.getTable(&quot;todo&quot;);\r\n        \r\n        return actualTable;\r\n    }\r\n    \r\n    \/\/\u671f\u5f85\u5024\u3068\u306a\u308b\u30c7\u30fc\u30bf\u3092\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u53d6\u5f97\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3002\u5f15\u6570\u306f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\r\n    private ITable getexpectedTable(String filepath) throws Exception  {\r\n        \r\n        IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(new File(filepath));\r\n        ITable expectedTable = expectedDataSet.getTable(&quot;todo&quot;);\r\n        \r\n        return expectedTable;\r\n    }\r\n    \r\n    \/\/DBunit\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n    @Override\r\n    protected DataSource getDataSource() {\r\n        \/\/ TODO \u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30e1\u30bd\u30c3\u30c9\u30fb\u30b9\u30bf\u30d6\r\n        return dataSourceTest;\r\n    }\r\n    \r\n    \/\/DBunit\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\r\n    @Override\r\n    protected IDataSet getDataSet() throws Exception {\r\n        \/\/ TODO \u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30e1\u30bd\u30c3\u30c9\u30fb\u30b9\u30bf\u30d6\r\n        return new FlatXmlDataSetBuilder().build(new FileInputStream(RESOURCE_DIR + &quot;test_data.xml&quot;));\r\n    }\r\n}\r\n<\/pre>\n<p>DBUnit\u306e\u51e6\u7406\u306b\u3064\u3044\u3066\u3001xml\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u307e\u3059\u3002<\/p>\n<h3 id=\"outline__2_4\">\u3010\u305d\u306e\u4ed6\u8a2d\u5b9a\u3011<\/h3>\n<p>test-context-dbunit.xml<br \/>\nDBunit\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306b\u5c11\u3057test-context.xml\uff08<a href=\"https:\/\/ito-u-oti.com\/spring-framework%E3%81%AEunit%E3%83%86%E3%82%B9%E3%83%88%E5%AE%9F%E8%A3%85%E6%96%B9%E6%B3%95%E3%80%801-1-repository%E3%83%86%E3%82%B9%E3%83%88junit4-spring-test\/\">1-1\u53c2\u7167<\/a>\uff09\u3092\u66f8\u304d\u63db\u3048\u3066\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u3057\u306a\u3044\u3068DBunit\u304c\u3046\u307e\u304f\u52d5\u3044\u3066\u304f\u308c\u306a\u3044\u3089\u3057\u3044\u30fb\u30fb\u30fb<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;bean id=&quot;log4jDataSource&quot; class=&quot;net.sf.log4jdbc.Log4jdbcProxyDataSource&quot;&gt;\r\n    &lt;constructor-arg index=&quot;0&quot; ref=&quot;realDataSource&quot; \/&gt;\r\n&lt;\/bean&gt;\r\n    \r\n&lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy&quot;&gt;\r\n    &lt;constructor-arg index=&quot;0&quot; ref=&quot;log4jDataSource&quot; \/&gt;\r\n&lt;\/bean&gt;\r\n<\/pre>\n<p>test_data.xml<br \/>\n\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7528\u306e\u30c7\u30fc\u30bf\u3067\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;dataset&gt;\r\n    &lt;TODO TODO_ID=&quot;cceae402-c5b1-440f-bae2-7bee19dc17fb&quot; TODO_TITLE=&quot;one&quot; FINISHED=&quot;false&quot; CREATED_AT=&quot;2017-10-01 15:39:17.888&quot; \/&gt;\r\n    &lt;TODO TODO_ID=&quot;5dd4ba78-ff5b-423b-aa2a-a07118aeaf90&quot; TODO_TITLE=&quot;two&quot; FINISHED=&quot;false&quot; CREATED_AT=&quot;2017-10-01 15:39:19.981&quot; \/&gt;\r\n    &lt;TODO TODO_ID=&quot;e3bdb9af-3dde-40b7-b5fb-4b388567ab45&quot; TODO_TITLE=&quot;three&quot; FINISHED=&quot;false&quot; CREATED_AT=&quot;2017-10-01 15:39:28.437&quot; \/&gt;\r\n&lt;\/dataset&gt;\r\n<\/pre>\n<p>compare_data.xml<br \/>\n\u30c6\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u5f8c\u306e\u691c\u8a3c\u7528\u30c7\u30fc\u30bf\u3067\u3059\u3002<br \/>\n\u30c6\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u306e\u5185\u5bb9\u304c\u3001ID&#8221;cceae402-c5b1-440f-bae2-7bee19dc17fb&#8221;\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066Finished\u3092true\u306b\u3059\u308b\u5185\u5bb9\u306a\u306e\u3067\u3001<br \/>\ntest_data.xml\u306e\u5185\u5bb9\u304b\u3089ID=&#8221;cceae402-c5b1-440f-bae2-7bee19dc17fb&#8221;\u306eFINISHED\u3092&#8221;true&#8221;\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;dataset&gt;\r\n    &lt;TODO TODO_ID=&quot;5dd4ba78-ff5b-423b-aa2a-a07118aeaf90&quot; TODO_TITLE=&quot;two&quot; FINISHED=&quot;false&quot; CREATED_AT=&quot;2017-10-01 15:39:19.981&quot; \/&gt;\r\n    &lt;TODO TODO_ID=&quot;cceae402-c5b1-440f-bae2-7bee19dc17fb&quot; TODO_TITLE=&quot;one&quot; FINISHED=&quot;true&quot; CREATED_AT=&quot;2017-10-01 15:39:17.888&quot; \/&gt;\r\n    &lt;TODO TODO_ID=&quot;e3bdb9af-3dde-40b7-b5fb-4b388567ab45&quot; TODO_TITLE=&quot;three&quot; FINISHED=&quot;false&quot; CREATED_AT=&quot;2017-10-01 15:39:28.437&quot; \/&gt;\r\n&lt;\/dataset&gt;\r\n<\/pre>\n<p>xml\u3067\u3069\u3093\u3069\u3093\u30c7\u30fc\u30bf\u3092\u66f8\u3044\u3066\u3044\u3051\u3070\u3044\u3044\u306e\u3067\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u304b\u3082\u542b\u3081\u3066\u3084\u3063\u3071\u308aDBUnit\u306b\u3088\u308b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u306d\u3002<br \/>\n\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3082\u3084\u3063\u3066\u304f\u308c\u308b\u3057\u3002<br \/>\n\u3061\u306a\u307f\u306b\u30c6\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u5f8c\u306e\u30c6\u30fc\u30d6\u30eb\u30c7\u30fc\u30bf\u3068\u3001compare_data.xml\u306e\u5185\u5bb9\u304c\u7570\u306a\u3063\u3066\u3044\u305f\u5834\u5408\u3001<br \/>\nJunit\u4e0a\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u4f8b\u306e\u30d0\u30fc\u304c\u8d64\u304f\u306a\u308b\uff09<br \/>\n\u3061\u3087\u3063\u3068\u9762\u5012\u306a\u306e\u304c\u3001compare_data.xml\u306e\u4e2d\u306e\u30c7\u30fc\u30bf\u306e\u9806\u756a\u307e\u3067\u5408\u308f\u305b\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u3053\u3068\u3067\u3059\u3002\u3002\u3002<br \/>\n\u81ea\u5206\u304c\u3084\u3063\u305f\u9650\u308a\u3067\u306f\u66f4\u65b0\u5f8c\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u9806\u756a\u306b\u3061\u3083\u3093\u3068\u5408\u308f\u305b\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001<br \/>\n\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3060\u3051\u898b\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3068\u304b\u3067\u304d\u306a\u3044\u306e\u3067\u3059\u304b\u306d\u30fb\u30fb\u30fb<\/p>\n<p><span class=\"markerYellow\">\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306fgithub\u3067\u516c\u958b\u3057\u3066\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/github.com\/itouoti12\/Spring-Unit-Test-pattern3\">Spring-Unit-Test-pattern3<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Jun [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45,27,25,28,40,24],"tags":[16,11,13,10,42,41],"class_list":["post-105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dbunit","category-junit","category-maven","category-mybatis","category-repository-test","category-spring","tag-dbunit","tag-junit","tag-mybatis","tag-spring","tag-spring-test","tag-unittest"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u3044\u3068\u3068\u3044\"\/>\n\t<meta name=\"google-site-verification\" content=\"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM\" \/>\n\t<meta name=\"keywords\" content=\"mybatis,spring,unittest,junit,spring-test,dbunit,\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/ito-u-oti.com\/?p=105\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:description\" content=\"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ito-u-oti.com\/?p=105\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-10-09T11:52:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2018-05-05T10:15:38+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@itouoti_IoT\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#article\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 1-3.Repository\\u30c6\\u30b9\\u30c8(Junit4, spring-test, DBUnit) | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"headline\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30001-3.Repository\\u30c6\\u30b9\\u30c8(Junit4, spring-test, DBUnit)\",\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/spring.png\",\"width\":900,\"height\":900},\"datePublished\":\"2017-10-09T20:52:34+09:00\",\"dateModified\":\"2018-05-05T19:15:38+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#webpage\"},\"articleSection\":\"DBunit, Junit, maven, mybatis, Repository Test, spring, dbunit, Junit, mybatis, spring, spring-test, UnitTest\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"position\":1,\"name\":\"\\u30db\\u30fc\\u30e0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"position\":2,\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"position\":3,\"name\":\"spring\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=40#listItem\",\"name\":\"Repository Test\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=40#listItem\",\"position\":4,\"name\":\"Repository Test\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=40\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#listItem\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30001-3.Repository\\u30c6\\u30b9\\u30c8(Junit4, spring-test, DBUnit)\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#listItem\",\"position\":5,\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30001-3.Repository\\u30c6\\u30b9\\u30c8(Junit4, spring-test, DBUnit)\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=40#listItem\",\"name\":\"Repository Test\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#personImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#authorImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#webpage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 1-3.Repository\\u30c6\\u30b9\\u30c8(Junit4, spring-test, DBUnit) | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 1-3.Repository\\u30c6\\u30b9\\u30c8(Junit4,\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/spring.png\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105\\\/#mainImage\",\"width\":900,\"height\":900},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=105#mainImage\"},\"datePublished\":\"2017-10-09T20:52:34+09:00\",\"dateModified\":\"2018-05-05T19:15:38+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/\",\"name\":\"\\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"music\\u00d7IT\\u00d7guiter\\u00d7programing\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,","canonical_url":"https:\/\/ito-u-oti.com\/?p=105","robots":"max-image-preview:large","keywords":"mybatis,spring,unittest,junit,spring-test,dbunit,","webmasterTools":{"google-site-verification":"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ito-u-oti.com\/?p=105#article","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","headline":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit)","author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png","width":900,"height":900},"datePublished":"2017-10-09T20:52:34+09:00","dateModified":"2018-05-05T19:15:38+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=105#webpage"},"isPartOf":{"@id":"https:\/\/ito-u-oti.com\/?p=105#webpage"},"articleSection":"DBunit, Junit, maven, mybatis, Repository Test, spring, dbunit, Junit, mybatis, spring, spring-test, UnitTest"},{"@type":"BreadcrumbList","@id":"https:\/\/ito-u-oti.com\/?p=105#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/ito-u-oti.com","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","position":2,"name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","item":"https:\/\/ito-u-oti.com\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","name":"\u30db\u30fc\u30e0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","position":3,"name":"spring","item":"https:\/\/ito-u-oti.com\/?cat=24","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=40#listItem","name":"Repository Test"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=40#listItem","position":4,"name":"Repository Test","item":"https:\/\/ito-u-oti.com\/?cat=40","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=105#listItem","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit)"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=105#listItem","position":5,"name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30001-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit)","previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=40#listItem","name":"Repository Test"}}]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/#person","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=105#personImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/?author=1#author","url":"https:\/\/ito-u-oti.com\/?author=1","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=105#authorImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"WebPage","@id":"https:\/\/ito-u-oti.com\/?p=105#webpage","url":"https:\/\/ito-u-oti.com\/?p=105","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,","inLanguage":"ja","isPartOf":{"@id":"https:\/\/ito-u-oti.com\/#website"},"breadcrumb":{"@id":"https:\/\/ito-u-oti.com\/?p=105#breadcrumblist"},"author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"creator":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png","@id":"https:\/\/ito-u-oti.com\/?p=105\/#mainImage","width":900,"height":900},"primaryImageOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=105#mainImage"},"datePublished":"2017-10-09T20:52:34+09:00","dateModified":"2018-05-05T19:15:38+09:00"},{"@type":"WebSite","@id":"https:\/\/ito-u-oti.com\/#website","url":"https:\/\/ito-u-oti.com\/","name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"music\u00d7IT\u00d7guiter\u00d7programing","inLanguage":"ja","publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"}}]},"og:locale":"ja_JP","og:site_name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:type":"article","og:title":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,","og:url":"https:\/\/ito-u-oti.com\/?p=105","og:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png","og:image:secure_url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png","og:image:width":900,"og:image:height":900,"article:published_time":"2017-10-09T11:52:34+00:00","article:modified_time":"2018-05-05T10:15:38+00:00","twitter:card":"summary","twitter:title":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4, spring-test, DBUnit) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","twitter:description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 1-3.Repository\u30c6\u30b9\u30c8(Junit4,","twitter:creator":"@itouoti_IoT","twitter:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png"},"aioseo_meta_data":{"post_id":"105","title":null,"description":null,"keywords":[{"label":"mybatis","value":"mybatis"},{"label":"spring","value":"spring"},{"label":"UnitTest","value":"UnitTest"},{"label":"Junit","value":"Junit"},{"label":"spring-test","value":"spring-test"},{"label":"dbunit","value":"dbunit"},{"label":"","value":""}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-11 14:09:28","updated":"2025-06-04 05:44:48","seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=105"}],"version-history":[{"count":4,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":431,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions\/431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/93"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}