{"id":12134,"date":"2013-04-30T19:00:16","date_gmt":"2013-04-30T16:00:16","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=12134"},"modified":"2013-04-30T08:33:31","modified_gmt":"2013-04-30T05:33:31","slug":"spring-mvc-introduction-in-testing","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html","title":{"rendered":"Spring MVC: Introduction in testing"},"content":{"rendered":"<p>Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a working state. There are a lot of different types of test and methodologies. In this article I want to make an introduction in unit testing of applications based on Spring MVC. Don\u2019t hope to read all about Spring MVC testing here, because it\u2019s just a first article about unit testing.<img decoding=\"async\" class=\"alignright\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-test-MVC.png\" width=\"300\" height=\"225\" \/><\/p>\n<p>Speak about unit testing without some application, which I\u2019m going to test is deception. I\u2019ll use <a title=\"Spring MVC Hibernate application\" href=\"http:\/\/fruzenshtein.com\/spring-mvc-hibernate-maven-crud\/\" target=\"_blank\">one of my applications<\/a> from the previous post, to avoid a gossip. I<br \/>\n&nbsp;<br \/>\nrecommend to make a short overview of the application before you proceed read current post. The main goal of this tutorial is to demonstrate how to configure unit tests for a Spring MVC application in annotation maner.<\/p>\n<h2>Preparations<\/h2>\n<p>The first thing which we always have to do before start any development \u2013 add of new dependencies in Maven\u2019s pom.xml file. This case isn\u2019t an exception.<\/p>\n<pre class=\" brush:xml\">...\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupid&gt;org.springframework&lt;\/groupid&gt;\r\n\t\t\t&lt;artifactid&gt;spring-test&lt;\/artifactid&gt;\r\n\t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;test&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupid&gt;org.springframework&lt;\/groupid&gt;\r\n\t\t\t&lt;artifactid&gt;spring-test-mvc&lt;\/artifactid&gt;\r\n\t\t\t&lt;version&gt;1.0.0.M1&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;test&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n...\r\n\t&lt;repositories&gt;\r\n\t\t&lt;repository&gt;\r\n\t\t\t&lt;id&gt;spring-maven-milestone&lt;\/id&gt;\r\n\t\t\t&lt;name&gt;Spring Maven Milestone Repository&lt;\/name&gt;\r\n\t\t\t&lt;url&gt;http:\/\/maven.springframework.org\/milestone&lt;\/url&gt;\r\n\t\t&lt;\/repository&gt;\r\n\t&lt;\/repositories&gt;\r\n...<\/pre>\n<p>I have added two new dependencies:<\/p>\n<ol>\n<li>#1 spring-test<\/li>\n<li>#2 spring-test-mvc<\/li>\n<\/ol>\n<p>The first one is for support for testing Spring applications with tools such as JUnit and TestNG. This artifact is generally always defined with a \u2018test\u2019 scope for the integration testing framework and unit testing stubs. The second one is for testing Spring MVC server-side and client-side RestTemplate-based code. Pay your attention that I added a new repository. I did this because spring-test-mvc still isn\u2019t in official maven repository.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>Controller for the unit tests<\/h2>\n<p>In this post I\u2019m going to write two unit tests for the most simple controller. Here is a code of the controller:<\/p>\n<pre class=\" brush:java\">@Controller  \r\n    public class LinkController {  \r\n\r\n        @RequestMapping(value=\"\/\")  \r\n        public ModelAndView mainPage() {  \r\n            return new ModelAndView(\"home\");  \r\n        }  \r\n\r\n        @RequestMapping(value=\"\/index\")  \r\n        public ModelAndView indexPage() {  \r\n            return new ModelAndView(\"home\");  \r\n        }  \r\n\r\n    }<\/pre>\n<p>So as you can see the methods in the controller is trivial, they just return some JSP. The testing of the controller implies check of request status (in success case the code should be 200) and verification of the view\u2019s name.<\/p>\n<h2>Writing of unit tests for Spring MVC<\/h2>\n<p>Here is a quote of <a title=\"Petri Kainulainen\" href=\"http:\/\/www.petrikainulainen.net\/about-me\/\" target=\"_blank\">Petri Kainulainen<\/a>:<\/p>\n<blockquote>\n<p>The heart of the spring-test-mvc is a class called MockMvc that can be used to write tests for any application implemented by using Spring MVC. Our goal is to create a new MockMvc object by using the implementations of the MockMvcBuilder interface. The MockMvcBuilders class has four static methods which we can use to obtain an implementation of the MockMvcBuilder interface. These methods are described in following:<\/p>\n<ul>\n<li>ContextMockMvcBuilder annotationConfigSetup(Class\u2026 configClasses) method must be used when we are using Java configuration for configuring the application context of our application.<\/li>\n<li>ContextMockMvcBuilder xmlConfigSetup(String\u2026 configLocations) must be used when the application context of our application is configured by using XML configuration files.<\/li>\n<li>StandaloneMockMvcBuilder standaloneSetup(Object\u2026 controllers) must be used when we want to configure the tested controller and the required MVC components manually.<\/li>\n<li>InitializedContextMockMvcBuilder webApplicationContextSetup(WebApplicationContext context) must be used when we have already created a fully initialized WebApplicationContext object.<\/li>\n<\/ul>\n<\/blockquote>\n<p>I\u2019m going to use the Web Application Context, for this purpose I need to create a class with configurations:<\/p>\n<pre class=\" brush:java\">package com.sprhib.init;\r\n\r\nimport org.springframework.context.annotation.*;\r\nimport org.springframework.web.servlet.config.annotation.EnableWebMvc;\r\nimport org.springframework.web.servlet.view.*;\r\n\r\n@Configuration\r\n@ComponentScan(\"com.sprhib\")\r\n@EnableWebMvc\r\npublic class BaseTestConfig {\r\n\r\n\t@Bean\r\n\tpublic UrlBasedViewResolver setupViewResolver() {\r\n\t\tUrlBasedViewResolver resolver = new UrlBasedViewResolver();\r\n\t\tresolver.setPrefix(\"\/WEB-INF\/pages\/\");\r\n\t\tresolver.setSuffix(\".jsp\");\r\n\t\tresolver.setViewClass(JstlView.class);\r\n\t\treturn resolver;\r\n\t}\r\n\r\n}<\/pre>\n<p>And finally the class with the tests:<\/p>\n<pre class=\" brush:java\">package com.sprhib.test;\r\n\r\nimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;\r\nimport static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;\r\nimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;\r\n\r\nimport org.junit.Before;\r\nimport org.junit.Test;\r\nimport org.junit.runner.RunWith;\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.test.context.ContextConfiguration;\r\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\r\nimport org.springframework.test.context.web.WebAppConfiguration;\r\nimport org.springframework.test.web.servlet.MockMvc;\r\nimport org.springframework.test.web.servlet.setup.MockMvcBuilders;\r\nimport org.springframework.web.context.WebApplicationContext;\r\n\r\nimport com.sprhib.init.BaseTestConfig;\r\n\r\n@RunWith(SpringJUnit4ClassRunner.class)\r\n@WebAppConfiguration\r\n@ContextConfiguration(classes=BaseTestConfig.class)\r\npublic class LinkControllerTest {\r\n\r\n\t@Autowired\r\n\tprivate WebApplicationContext wac;\r\n\r\n\tprivate MockMvc mockMvc;\r\n\r\n\t@Before\r\n\tpublic void init() {\r\n\t\tmockMvc = MockMvcBuilders.webAppContextSetup(wac).build();\r\n\t}\r\n\r\n\t@Test\r\n\tpublic void testHomePage() throws Exception {\r\n\t\tmockMvc.perform(get(\"\/\"))\r\n\t\t\t.andExpect(status().isOk())\r\n\t\t\t.andExpect(view().name(\"home\"));\r\n\t}\r\n\r\n\t@Test\r\n\tpublic void testIndexPage() throws Exception {\r\n\t\tmockMvc.perform(get(\"\/index.html\"))\r\n\t\t\t.andExpect(status().isOk())\r\n\t\t\t.andExpect(view().name(\"home\"));\r\n\t}\r\n\r\n}<\/pre>\n<p>Notice that I have used static imports they provide usage of such methods as get(), status() etc. <em>@WebAppConfiguration<\/em> is a class-level annotation that is used to declare that the ApplicationContext loaded for an integration test should be a WebApplicationContext. Look at the project structure after I have added all testing stuff:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-test-MVC.jpg\" width=\"268\" height=\"415\" \/><\/p>\n<p>Check <a href=\"https:\/\/github.com\/Fruzenshtein\/spr-mvc-hib\" target=\"_blank\">the project<\/a> on GitHub. I hope everything is clear. Spring test MVC project is a good tool for the testing of the appropriate applications. There\u2019s just one cons lack of documentation and tutorials. In the next tutorials I\u2019m going to develop this theme.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/fruzenshtein.com\/spring-mvc-introduction-in-testing\/\">Spring MVC: Introduction in testing<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Alexey Zvolinskiy at the <a href=\"http:\/\/fruzenshtein.com\/\">Fruzenshtein&#8217;s notes<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a working state. There are a lot of different types of test and methodologies. In this article I want to make an introduction in unit testing of applications based &hellip;<\/p>\n","protected":false},"author":374,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,150],"class_list":["post-12134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-mvc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring MVC: Introduction in testing<\/title>\n<meta name=\"description\" content=\"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC: Introduction in testing\" \/>\n<meta property=\"og:description\" content=\"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-30T16:00:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexey Zvolinskiy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexey Zvolinskiy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html\"},\"author\":{\"name\":\"Alexey Zvolinskiy\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\"},\"headline\":\"Spring MVC: Introduction in testing\",\"datePublished\":\"2013-04-30T16:00:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html\"},\"wordCount\":635,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring MVC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html\",\"name\":\"Spring MVC: Introduction in testing\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2013-04-30T16:00:16+00:00\",\"description\":\"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-introduction-in-testing.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring MVC: Introduction in testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\",\"name\":\"Alexey Zvolinskiy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"caption\":\"Alexey Zvolinskiy\"},\"description\":\"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.\",\"sameAs\":[\"http:\\\/\\\/fruzenshtein.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/alexey-zvolinskiy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring MVC: Introduction in testing","description":"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html","og_locale":"en_US","og_type":"article","og_title":"Spring MVC: Introduction in testing","og_description":"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a","og_url":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-04-30T16:00:16+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Alexey Zvolinskiy","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alexey Zvolinskiy","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html"},"author":{"name":"Alexey Zvolinskiy","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02"},"headline":"Spring MVC: Introduction in testing","datePublished":"2013-04-30T16:00:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html"},"wordCount":635,"commentCount":6,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring MVC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html","url":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html","name":"Spring MVC: Introduction in testing","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2013-04-30T16:00:16+00:00","description":"Testing is one of the most important parts of software development. Well organized testing helps to keep a code of application in a good state, in a","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-introduction-in-testing.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring MVC: Introduction in testing"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02","name":"Alexey Zvolinskiy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","caption":"Alexey Zvolinskiy"},"description":"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.","sameAs":["http:\/\/fruzenshtein.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/alexey-zvolinskiy"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/374"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=12134"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=12134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=12134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=12134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}