{"id":50911,"date":"2016-01-09T15:00:57","date_gmt":"2016-01-09T13:00:57","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=50911"},"modified":"2016-01-09T10:24:40","modified_gmt":"2016-01-09T08:24:40","slug":"container-object-pattern-new-pattern-tests","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html","title":{"rendered":"Container Object pattern. A new pattern for your tests."},"content":{"rendered":"<p>If you search for a description of what <i>Page Object<\/i> is, you\u2019ll find that The <i>Page Object Pattern<\/i> gives us a common sense way to model content in a reusable and maintainable way.<\/p>\n<p>And also points that: Within your web app\u2019s UI there are areas that your tests interact with. A <i>Page Object<\/i> simply models these as objects within the test code.<\/p>\n<p>This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place.<\/p>\n<p>As you can see, <i>Page Object<\/i> applies to UI elements. We (the<b>Arquillian<\/b>\u00a0 community) has coined a new pattern following<i> Page Object<\/i> pattern logic called <b>Container Object<\/b> pattern.<\/p>\n<p>You can think about <b>Container Objec<\/b>t as areas of a container (for now <i>Docker<\/i> container) that your test might interact with. For example some of these areas could be:<\/p>\n<ul>\n<li>To get the host IP where container is running.<\/li>\n<li>The bounded port for a given exposed port.<\/li>\n<li>Any parameter configured inside the configuration file (Dockerfile) like a user or password to access to the service which the container exposes.<\/li>\n<li>Definition of the containers.<\/li>\n<\/ul>\n<p>A <b>Container Object<\/b> might contain an aggregation of more than one Container Object inside it. This effectively builds a relation ship (link) between containers.<\/p>\n<p>An example of configuration parameters might be for example, in case of running a MySQL database in a container, it could be the user and password to access to database.<\/p>\n<p>Notice that nothing prevents you to generate the correct URL for accessing to the service from the test, or execute commands against container like retrieving an internal file.<\/p>\n<p>And of course as <i>Page Object<\/i> does, <b>Container Object<\/b> gives you a way to build a model content that can be reused for several projects.<\/p>\n<p>Before looking at how this pattern is implemented in <b>Arquillian Cube<\/b>, let\u2019s go thorough an example:<\/p>\n<p>Suppose all of your applications need to send a file to an FTP server. To write an integration\/component test you might need a FTP server to send the file and check that the file was correctly sent.<\/p>\n<p>One way to do this is using Docker to start a FTP server just before executing the test, then execute the test using this Docker container for FTP server, before stopping the container check that the file is there, and finally stop the container.<\/p>\n<p>So all these operations that involves the FTP server and container could be joined inside a <b>Container Object<\/b>. This container object might contain information of:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li>Which image is used<\/li>\n<li>IP and bounded port of host where this FTP server is running<\/li>\n<li>Username and password to access to the FTP server<\/li>\n<li>Methods for asserting the existence of a file<\/li>\n<\/ul>\n<p>Then from the point of view of test, it only communicate with this object instead of directly hard coding all information inside the test.<\/p>\n<p>Again as in <i>Page Object<\/i>, any change on the container only affects the <b>Container Object<\/b> and not the test itself.<\/p>\n<p>Now let\u2019s see how <b>Arquillian Cube<\/b> implements <b>Container Object<\/b> pattern with a very simple example:<\/p>\n<h2>Arquillian Cube and Container Object<\/h2>\n<p>Let\u2019s see a simple example on how you can implement a <b>Container Object<\/b> in <b>Cube<\/b>. Suppose you want to create a container object that encapsulates a ping pong server running inside Docker.<\/p>\n<p>The <b>Container Object<\/b> will be like a simple POJO with special annotations:<\/p>\n<pre class=\" brush:java\">@Cube(value = \"pingpong\", portBinding = \"5000-&gt;8080\/tcp\") \/\/ &lt;1&gt;\r\n@CubeDockerFile\r\npublic class PingPongContainer {\r\n\r\n  @HostIp \/\/ &lt;2&gt;\r\n  String dockerHost;\r\n\r\n  @HostPort(8080) \/\/ &lt;3&gt;\r\n  private int port;\r\n\r\n  public URL getConnectionUrl() { \/\/ &lt;4&gt;\r\n    try {\r\n      return new URL(\u201chttp:\/\/\u201d + dockerHost + \u201c:\u201d + port);\r\n\t  } catch (MalformedURLException e) {\r\n\t\t  throw new IllegalArgumentException(e);\r\n\t  }\r\n  }\r\n}<\/pre>\n<p>In previous example you must pay attention at next lines:<\/p>\n<ol>\n<li><i>@Cube<\/i> annotation configures <b>Container Object<\/b>.<\/li>\n<li>A <b>Container Object<\/b> can be enriched with Arquillian enrichers.<\/li>\n<li>Bounded port is injected for given exposed port.<\/li>\n<li><b>Container Object<\/b> hides how to connect to PingPong server.<\/li>\n<\/ol>\n<p><i>@Cube<\/i> annotation is used to configure this <b>Container Object<\/b>. Initially you set that the started container will be named pingpong and the port binding information for the container instance, in this case <i>5000\u21928080\/tcp<\/i>.<\/p>\n<p>Notice that this can be an array to set more than one port binding definition.<\/p>\n<p>Next annotation is <i>@CubeDockerFile<\/i> which configure how Container is created. In this case using a <i>Dockerfile<\/i> located at default <b>classpath<\/b> location. The default location is the<i>package+classname<\/i>, so for example in previous case, <i>Dockerfile<\/i> should be placed at <i>org\/superbiz\/containerobject\/PingPongContainer <\/i>directory.<\/p>\n<p>Of course you can set any other class path location by passing as value of the annotation. <i>CubeDockerFile<\/i> annotation sets the location where the <i>Dockerfile<\/i> is found and not the file itself.<\/p>\n<p>Also this location should be reachable from <i>ClassLoader<\/i>, so it means it should be loaded from classpath in order to find it.<\/p>\n<p>Any <i>Cube<\/i> can be enriched with any client side enricher, in this case with <i>@HostIp<\/i> enricher, but it could be enriched with <i>DockerClient<\/i> using <i>@ArquillianResource<\/i> as well.<\/p>\n<p>Finally the <i>@HostPort<\/i> is used to translate the exposed port to bound port.<\/p>\n<p>So in this example port value will be <i>5000<\/i>. You are going to learn briefly why this annotation is important.<\/p>\n<p>And then you can start using this container object in your test:<\/p>\n<pre class=\" brush:java\">@RunWith(Arquillian.class)\r\npublic class PingPongTest {\r\n\r\n    @Cube\r\n    PingPongContainer pingPongContainer;\r\n\r\n    @Test\r\n    public void shouldReturnOkAsPong() throws IOException {\r\n        String pong = ping();\r\n        assertThat(pong, containsString(\"OK\"));\r\n        assertThat(pingPongContainer.getConnectionPort(), is(5000));\r\n    }\r\n}<\/pre>\n<p>The most important thing here is that you need to set <b>Container Object<\/b> as a field of the class and annotate with <i>@Cube<\/i>.<\/p>\n<p>It is very important to annotate the field with <i>Cube<\/i>, so before <b>Arquillian<\/b> runs the test, it can detect that it needs to start a new <i>Cube<\/i> (Docker container), create the <b>Container Object<\/b> and inject it in the test.<\/p>\n<p>Notice that this annotation is exactly the same as used when you defined the <b>Container Object<\/b>.<\/p>\n<p>And it is in this way because you can override any property of the <b>Container Object<\/b> from the test side. This is why <i>@HostPort<\/i> annotation is important, since port can be changed from the test definition, you need to find a way to inject the correct port inside the container object.<\/p>\n<p>In this post I have introduced <b>Container Object<\/b> pattern and how can be used in <b>Arquillian Cube<\/b>. But this is only an small taste, you can read more about <b>Arquillian Cube<\/b> and <b>Container Object <\/b>integration at:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/arquillian\/arquillian-cube#arquillian-cube-and-container-object\">https:\/\/github.com\/arquillian\/arquillian-cube#arquillian-cube-and-container-object<\/a><\/li>\n<\/ul>\n<p>Also a running examples can be found at:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/arquillian\/arquillian-cube\/tree\/master\/docker\/ftest-docker-containerobject\">https:\/\/github.com\/arquillian\/arquillian-cube\/tree\/master\/docker\/ftest-docker-containerobject<\/a><\/li>\n<\/ul>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.lordofthejars.com\/2016\/01\/container-object-pattern-new-pattern.html\">Container Object pattern. A new pattern for your tests.<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Alex Soto at the <a href=\"http:\/\/www.lordofthejars.com\/\">One Jar To Rule Them All<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content in a reusable and maintainable way. And also points that: Within your web app\u2019s UI there are areas that your tests interact with. A Page Object simply models &hellip;<\/p>\n","protected":false},"author":119,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[273],"class_list":["post-50911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Container Object pattern. A new pattern for your tests. - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content 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\/2016\/01\/container-object-pattern-new-pattern-tests.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Container Object pattern. A new pattern for your tests. - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content in a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.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=\"2016-01-09T13:00:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-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=\"Alex Soto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/alexsotob\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Soto\" \/>\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\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html\"},\"author\":{\"name\":\"Alex Soto\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6566a1238c71f5d85ba5b5df5d2eac59\"},\"headline\":\"Container Object pattern. A new pattern for your tests.\",\"datePublished\":\"2016-01-09T13:00:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html\"},\"wordCount\":1039,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Testing\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html\",\"name\":\"Container Object pattern. A new pattern for your tests. - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2016-01-09T13:00:57+00:00\",\"description\":\"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content in a\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/container-object-pattern-new-pattern-tests.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\":\"Container Object pattern. A new pattern for your tests.\"}]},{\"@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\\\/6566a1238c71f5d85ba5b5df5d2eac59\",\"name\":\"Alex Soto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"caption\":\"Alex Soto\"},\"sameAs\":[\"http:\\\/\\\/www.lordofthejars.com\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/alexsotob\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Alex-Soto\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Container Object pattern. A new pattern for your tests. - Java Code Geeks","description":"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content 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\/2016\/01\/container-object-pattern-new-pattern-tests.html","og_locale":"en_US","og_type":"article","og_title":"Container Object pattern. A new pattern for your tests. - Java Code Geeks","og_description":"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content in a","og_url":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-01-09T13:00:57+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Alex Soto","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/alexsotob","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alex Soto","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html"},"author":{"name":"Alex Soto","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6566a1238c71f5d85ba5b5df5d2eac59"},"headline":"Container Object pattern. A new pattern for your tests.","datePublished":"2016-01-09T13:00:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html"},"wordCount":1039,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Testing"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html","url":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html","name":"Container Object pattern. A new pattern for your tests. - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2016-01-09T13:00:57+00:00","description":"If you search for a description of what Page Object is, you\u2019ll find that The Page Object Pattern gives us a common sense way to model content in a","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/container-object-pattern-new-pattern-tests.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":"Container Object pattern. A new pattern for your tests."}]},{"@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\/6566a1238c71f5d85ba5b5df5d2eac59","name":"Alex Soto","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","caption":"Alex Soto"},"sameAs":["http:\/\/www.lordofthejars.com\/","https:\/\/x.com\/http:\/\/twitter.com\/alexsotob"],"url":"https:\/\/www.javacodegeeks.com\/author\/Alex-Soto"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/50911","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\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=50911"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/50911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=50911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=50911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=50911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}