{"id":123,"date":"2017-10-14T22:16:48","date_gmt":"2017-10-14T13:16:48","guid":{"rendered":"http:\/\/ito-u-oti.com\/?p=123"},"modified":"2018-05-05T19:50:54","modified_gmt":"2018-05-05T10:50:54","slug":"post-123","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=123","title":{"rendered":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test)"},"content":{"rendered":"<h2 id=\"outline__1\">Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test)<\/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\">2-1.Service\u30c6\u30b9\u30c8\u3000Junit4,Spring-test\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u305f\u30d1\u30bf\u30fc\u30f3<\/h2>\n<p>Service\u30af\u30e9\u30b9\u306e\u30c6\u30b9\u30c8\u3067\u3059\u3002<br \/>\nSpring-test\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u308aDI\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001<br \/>\nRepository\u30af\u30e9\u30b9\u3068Service\u30af\u30e9\u30b9\u3092\u7e4b\u3052\u305f\u8a66\u9a13\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u4f7f\u7528\u3057\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u306e\u4f8b\u3060\u3068\u3001Service\u30af\u30e9\u30b9\u3067Repository\u30af\u30e9\u30b9\u306eUpdate\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001<br \/>\nRepository\u30af\u30e9\u30b9\u3092\u30e2\u30c3\u30af\u5316\u3057\u306a\u3044\u3067\u305d\u306e\u307e\u307e\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\u51e6\u7406\u304c\u8d70\u308b\u611f\u3058\u3067\u3059\u3002<\/p>\n<h3 id=\"outline__2_1\">\u3010pom.xml\u3011<\/h3>\n<p>Junit\u30e9\u30a4\u30d6\u30e9\u30ea\u3068Spring-test\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3067\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&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>TodoService.java<br \/>\n\u30c6\u30b9\u30c8\u5bfe\u8c61\u306ffinish\u30e1\u30bd\u30c3\u30c9<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic interface TodoService {\r\n    Collection&lt;Todo&gt; findAll();\r\n    \r\n    Todo create(Todo todo);\r\n    \r\n    Todo finish(String todoId);\r\n    \r\n    void delete(String todoId);\r\n}\r\n<\/pre>\n<p>\u4eca\u56de\u306e\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u5834\u5408\u3001DI\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3046\u306e\u3067\u30c6\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3067\u8a66\u9a13\u3059\u308b\u6642\u306b\u5bfe\u8c61\u3068\u306a\u308b\u306e\u306f\u3053\u306eTodoService\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u3082\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3092\u76f4\u63a5\u30c6\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3067\u6307\u5b9a\u3057\u3066\u3082DI\u30b3\u30f3\u30c6\u30ca\u306e\u65b9\u3092\u901a\u3089\u305a\u306b\u3046\u307e\u304fRepository\u30af\u30e9\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u305a\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\nService\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6307\u5b9a\u3057\u3066DI\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u5b9f\u88c5\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3057\u3066\u8a66\u9a13\u3059\u308b\u3068\u3044\u3046\u3001\u9593\u63a5\u7684\u306b\u4f7f\u7528\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u304b\u306d\u3002<br \/>\n\u3061\u306a\u307f\u306b\u5b9f\u88c5\u30af\u30e9\u30b9\u306f\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u30c6\u30b9\u30c8\u5bfe\u8c61\u3068\u306a\u308bfinish\u30e1\u30bd\u30c3\u30c9\u306e\u90e8\u5206\u3060\u3051\u5207\u308a\u51fa\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>TodoServiceImpl.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Service\r\n@Transactional\r\npublic class TodoServiceImpl implements TodoService {\r\n\r\n    private static final long MAX_UNFINISHED_COUNT = 5;\r\n\r\n    @Inject\r\n    TodoRepository todoRepository;\r\n\r\n    @Override\r\n    public Todo finish(String todoId) {\r\n        \/\/ TODO \u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30e1\u30bd\u30c3\u30c9\u30fb\u30b9\u30bf\u30d6\r\n        Todo todo = findOne(todoId);\r\n        if (todo.isFinished()) {\r\n            ResultMessages messages = ResultMessages.error();\r\n            messages.add(ResultMessage.fromText(&quot;&#x5B;E002]The requested Todo is already finished. (id=&quot; + todoId + &quot;)&quot;));\r\n\r\n            throw new BusinessException(messages);\r\n        }\r\n        todo.setFinished(true);\r\n        todoRepository.update(todo);\r\n        return todo;\r\n    }\r\n}\r\n<\/pre>\n<h3 id=\"outline__2_3\">\u3010\u30c6\u30b9\u30c8\u30af\u30e9\u30b9\u3011<\/h3>\n<p>TodoServiceImplTest.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.xml&quot;})\r\n@Transactional\r\npublic class TodoServiceImplTest {\r\n\r\n    @Inject\r\n    TodoService target;\r\n    \r\n    @Before\r\n    public void setUp() throws Exception {\r\n        \/\/@sql\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305fsql\u30d5\u30a1\u30a4\u30eb\u306b\u3088\u3063\u3066\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u3001\u51e6\u7406\u306a\u3057\r\n    }\r\n    \r\n    \/\/\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u305f\u30d1\u30bf\u30fc\u30f3\r\n    @Test\r\n    @Rollback\r\n    \/\/\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b@sql\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308b\r\n    @Sql(&quot;classpath:database\/test_data_testFinishOK.sql&quot;)\r\n    public void testFinishOK() throws Exception{\r\n        \/\/\u5f15\u6570\u8a2d\u5b9a\r\n        String todoId = &quot;cceae402-c5b1-440f-bae2-7bee19dc17fb&quot;;\r\n        \r\n        \/\/finish\u30e1\u30bd\u30c3\u30c9\u306e\u30c6\u30b9\u30c8\r\n        Todo todo = target.finish(todoId);\r\n        \r\n        \/\/\u7d50\u679c\u691c\u8a3c\uff08assertTodo\u30e1\u30bd\u30c3\u30c9\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u5b9f\u884c\u306b\u3088\u3063\u3066\u8fd4\u3063\u3066\u304d\u305fTodo\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u691c\u8a3c\u3059\u308bprivate\u30e1\u30bd\u30c3\u30c9\uff09\r\n        assertTodo(todo);\r\n        \r\n    }\r\n    \r\n    \/\/\u53d6\u5f97\u3057\u305fTodo\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306efinished\u304c\u65e2\u306btrue\u3067\u7570\u5e38\u304c\u767a\u751f\u3057\u305f\u30d1\u30bf\u30fc\u30f3\r\n    \/\/@Test\u306eexpected\u306b\u306f\u671f\u5f85\u3059\u308bException\u30af\u30e9\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067Exception\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u306f\u60f3\u5b9a\u901a\u308a\u3068\u3044\u3046\u3053\u3068\u3092\u5ba3\u8a00\u3057\u3066\u3044\u308b\u3002\r\n    @Test(expected = BusinessException.class)\r\n    @Rollback\r\n    \/\/\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b@sql\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308b\u3002\u308f\u3056\u3068Exception\u3092\u767a\u751f\u3055\u305b\u308b\u305f\u3081\u3001testFinishOK\u30e1\u30bd\u30c3\u30c9\u306e\u6642\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u30c7\u30fc\u30bf\u3092\u5909\u3048\u3066\u3044\u308b\u3002\r\n    @Sql(&quot;classpath:database\/test_data_testFinishNG.sql&quot;)\r\n    public void testFinishNG() throws Exception{\r\n        \/\/\u5f15\u6570\u8a2d\u5b9a\r\n        String todoId = &quot;cceae402-c5b1-440f-bae2-7bee19dc17fb&quot;;\r\n        \r\n        \/\/try-catch\u6587\u306f\u306a\u304f\u3066\u3082Junit\u3068\u3057\u3066\u306f\u6b63\u5e38\u306b\u306a\u308b\u304c\u3001printStackTrace\u30e1\u30bd\u30c3\u30c9\u3067\u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u3092\u8868\u793a\u3055\u305b\u3066\u3044\u308b\u3002\r\n        try {\r\n            target.finish(todoId);\r\n        }catch (BusinessException e) {\r\n            \/\/ TODO: handle exception\r\n            e.printStackTrace();\r\n            \r\n            throw e;\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>\u60f3\u5b9a\u901a\u308a\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u3063\u3066\u304d\u305f\u6642\u306e\u30d1\u30bf\u30fc\u30f3\u3068\u3001<br \/>\n\u7570\u5e38\u304c\u767a\u751f\u3057\u305f\u6642\u306e\u30d1\u30bf\u30fc\u30f3\u306e2\u30d1\u30bf\u30fc\u30f3\u3092\u8a18\u8ff0\u3057\u307e\u3057\u305f\u3002<br \/>\n\u671f\u5f85\u901a\u308a\u306e\u7570\u5e38\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306f @Test(expected = Exception\u30af\u30e9\u30b9)\u3068\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001Junit\u306e\u30c6\u30b9\u30c8\u304c\u6210\u529f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"outline__2_4\">\u3010\u305d\u306e\u4ed6\u8a2d\u5b9a\u3011<\/h3>\n<p>test_data_testFinishOK.sql<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n\/* define the schemas. *\/\r\nCREATE TABLE IF NOT EXISTS todo (todo_id VARCHAR(36) PRIMARY KEY, todo_title VARCHAR(30), finished BOOLEAN, created_at TIMESTAMP);\r\nDELETE FROM todo;\r\n\r\n\/* load the records. *\/\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('cceae402-c5b1-440f-bae2-7bee19dc17fb', 'one', false, '2017-10-01 15:39:17.888');\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('5dd4ba78-ff5b-423b-aa2a-a07118aeaf90', 'two', false, '2017-10-01 15:39:19.981');\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('e3bdb9af-3dde-40b7-b5fb-4b388567ab45', 'three', false, '2017-10-01 15:39:28.437');\r\ncommit;\r\n<\/pre>\n<p>test_data_testFinishNG.sql<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n\/* define the schemas. *\/\r\nCREATE TABLE IF NOT EXISTS todo (todo_id VARCHAR(36) PRIMARY KEY, todo_title VARCHAR(30), finished BOOLEAN, created_at TIMESTAMP);\r\nDELETE FROM todo;\r\n\r\n\/* load the records. *\/\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('cceae402-c5b1-440f-bae2-7bee19dc17fb', 'one', true, '2017-10-01 15:39:17.888');\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('5dd4ba78-ff5b-423b-aa2a-a07118aeaf90', 'two', false, '2017-10-01 15:39:19.981');\r\nINSERT INTO todo (todo_id, todo_title, finished, created_at) VALUES ('e3bdb9af-3dde-40b7-b5fb-4b388567ab45', 'three', false, '2017-10-01 15:39:28.437');\r\ncommit;\r\n<\/pre>\n<p>\u3042\u3089\u304b\u3058\u3081finish\u30e1\u30bd\u30c3\u30c9\u5bfe\u8c61\u306e\u30c7\u30fc\u30bf\u3092true\u3068\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u7570\u5e38\u3092\u767a\u751f\u3055\u305b\u308b\u3002<\/p>\n<p>\u4e00\u70b9\u6ce8\u610f\u306a\u306e\u3067\u3059\u304c\u3001BusinessException\u3068\u3044\u3046\u306e\u306fTERASOLUNA\u306e\u6a5f\u80fd\u306b\u306a\u308b\u306e\u3067\u3001<br \/>\nSpring\u306e\u5358\u4f53\u30c6\u30b9\u30c8\u306b\u3064\u3044\u3066\u898b\u306b\u6765\u305f\u65b9\u306f\u300c\u306a\u3093\u3060\u3053\u308c\uff1f\u300d\u3063\u3066\u601d\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u7121\u8996\u3057\u3066\u5927\u4e08\u592b\u3067\u3059\u3002<br \/>\n\u3042\u3068ResultMessages\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u304b\u3082TERASOLUNA\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/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-pattern8\">Spring Unit Test pattern8<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,51,24,1],"tags":[11,10,42,41],"class_list":["post-123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-junit","category-service-test","category-spring","category-1","tag-junit","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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr\" \/>\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=\"spring,unittest,junit,spring-test\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/ito-u-oti.com\/?p=123\" \/>\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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ito-u-oti.com\/?p=123\" \/>\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-14T13:16:48+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2018-05-05T10:50:54+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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr\" \/>\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=123#article\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 2-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spring-test) | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"headline\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30002-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spring-test)\",\"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-14T22:16:48+09:00\",\"dateModified\":\"2018-05-05T19:50:54+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#webpage\"},\"articleSection\":\"Junit, Service Test, spring, \\u672a\\u5206\\u985e, Junit, spring, spring-test, UnitTest\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#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=51#listItem\",\"name\":\"Service 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=51#listItem\",\"position\":4,\"name\":\"Service Test\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=51\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#listItem\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30002-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spring-test)\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#listItem\",\"position\":5,\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5\\u30002-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spring-test)\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=51#listItem\",\"name\":\"Service 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=123#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=123#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=123#webpage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123\",\"name\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 2-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spring-test) | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"Spring Framework\\u306eUnit\\u30c6\\u30b9\\u30c8\\u5b9f\\u88c5\\u65b9\\u6cd5 2-1.Service\\u30c6\\u30b9\\u30c8(Junit4, spr\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#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=123\\\/#mainImage\",\"width\":900,\"height\":900},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=123#mainImage\"},\"datePublished\":\"2017-10-14T22:16:48+09:00\",\"dateModified\":\"2018-05-05T19:50:54+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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr","canonical_url":"https:\/\/ito-u-oti.com\/?p=123","robots":"max-image-preview:large","keywords":"spring,unittest,junit,spring-test","webmasterTools":{"google-site-verification":"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ito-u-oti.com\/?p=123#article","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","headline":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test)","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-14T22:16:48+09:00","dateModified":"2018-05-05T19:50:54+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=123#webpage"},"isPartOf":{"@id":"https:\/\/ito-u-oti.com\/?p=123#webpage"},"articleSection":"Junit, Service Test, spring, \u672a\u5206\u985e, Junit, spring, spring-test, UnitTest"},{"@type":"BreadcrumbList","@id":"https:\/\/ito-u-oti.com\/?p=123#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=51#listItem","name":"Service 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=51#listItem","position":4,"name":"Service Test","item":"https:\/\/ito-u-oti.com\/?cat=51","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=123#listItem","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test)"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=123#listItem","position":5,"name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5\u30002-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test)","previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=51#listItem","name":"Service 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=123#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=123#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=123#webpage","url":"https:\/\/ito-u-oti.com\/?p=123","name":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr","inLanguage":"ja","isPartOf":{"@id":"https:\/\/ito-u-oti.com\/#website"},"breadcrumb":{"@id":"https:\/\/ito-u-oti.com\/?p=123#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=123\/#mainImage","width":900,"height":900},"primaryImageOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=123#mainImage"},"datePublished":"2017-10-14T22:16:48+09:00","dateModified":"2018-05-05T19:50:54+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 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr","og:url":"https:\/\/ito-u-oti.com\/?p=123","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-14T13:16:48+00:00","article:modified_time":"2018-05-05T10:50:54+00:00","twitter:card":"summary","twitter:title":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spring-test) | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","twitter:description":"Spring Framework\u306eUnit\u30c6\u30b9\u30c8\u5b9f\u88c5\u65b9\u6cd5 2-1.Service\u30c6\u30b9\u30c8(Junit4, spr","twitter:creator":"@itouoti_IoT","twitter:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2017\/10\/spring.png"},"aioseo_meta_data":{"post_id":"123","title":null,"description":null,"keywords":[{"label":"spring","value":"spring"},{"label":"UnitTest","value":"UnitTest"},{"label":"Junit","value":"Junit"},{"label":"spring-test","value":"spring-test"}],"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":[]},"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\/123","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=123"}],"version-history":[{"count":5,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":439,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/123\/revisions\/439"}],"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=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}