diff --git a/jekyll-www.mock-server.com/_includes/footer.html b/jekyll-www.mock-server.com/_includes/footer.html index 532fb0b57..18a450df0 100644 --- a/jekyll-www.mock-server.com/_includes/footer.html +++ b/jekyll-www.mock-server.com/_includes/footer.html @@ -10,9 +10,11 @@ + - + + diff --git a/jekyll-www.mock-server.com/_sass/_accordion.scss b/jekyll-www.mock-server.com/_sass/_accordion.scss new file mode 100644 index 000000000..68cd2aa56 --- /dev/null +++ b/jekyll-www.mock-server.com/_sass/_accordion.scss @@ -0,0 +1,49 @@ +/* Style the buttons that are used to open and close the accordion panel */ +.accordion { + font-family: 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; + background-color: #eee; + color: #444; + cursor: pointer; + padding: 18px; + width: 100%; + text-align: left; + border: none; + outline: none; + transition: 0.5s; + margin: 1px; + vertical-align: middle; +} + +.accordion.inner { + background-color: #000; + color: #fff; + padding: 2px 8px; + width: 100%; + margin: 6px; +} + +/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ +.active, .accordion:hover { + background-color: #ccc; +} + +/* Style the accordion panel. Note: hidden by default */ +.panel { + padding: 0 18px; + background-color: white; + display: none; +} + +button.accordion.active:after { + content: "\2212"; +} + +button.accordion:after { + content: '\002B'; + color: #cc1313; + font-weight: bold; + float: right; + margin-left: 5px; + font-family: 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 1.1em; +} diff --git a/jekyll-www.mock-server.com/_sass/_prettify.scss b/jekyll-www.mock-server.com/_sass/_prettify.scss new file mode 100644 index 000000000..358b1469c --- /dev/null +++ b/jekyll-www.mock-server.com/_sass/_prettify.scss @@ -0,0 +1,147 @@ +/* Pretty printing styles. Used with prettify.js. */ + +pre .str, code .str { color: #5BA382; } /* string - green */ +pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ +pre .com, code .com { color: #9c9c9c; font-style: italic; } /* comment - gray */ +pre .typ, code .typ { color: #5B93DA; } /* type - light blue */ +pre .lit, code .lit { color: #3387CC; } /* literal - blue */ +pre .pun, code .pun { color: #fff; } /* punctuation - white */ +pre .pln, code .pln { color: #e2e2e2; } /* plaintext - white */ +pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ +pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ +pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +pre.prettyprint, code.prettyprint { + background-color: #0f0101; + border-radius: 8px; +} + +pre.prettyprint { + width: 95%; + margin: 1em auto; + white-space: pre-wrap; + font-family: Menlo, Monaco, "Courier New", monospace; +} + +.code { + display: block; + white-space: pre; + overflow: auto; + padding: 1%; + background-color: #0f0101; + color: #F1F1F1; + border-radius: 8px; + font-size: 1em; +} + +.inline { + display: inline; + white-space: pre; + word-wrap: normal; + overflow: auto; + margin: 0; + line-height: 3.5em; +} + +.xml { + color: #C9C9C9; +} + +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +li.L1,li.L3,li.L5,li.L7,li.L9 { background: none; } + +@media print { + pre .str, code .str { color: #060; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #600; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #006; font-weight: bold; } + pre .atn, code .atn { color: #404; } + pre .atv, code .atv { color: #060; } +} + +/* OLD */ +span.keyword { + color: #5B93DA; +} + +span.annotation { + color: #bdb76b; +} + +span.inline_code { + color: #2b2b2b; + font-size: 1.1em; + font-weight: bolder; +} + +span.numeric_literal { + color: #008dff; +} + +span.final, +span.constant { + color: #e28964; + font-style: italic; +} + +span.ruby_constant { + color: #e28964; +} + +span.string_literal, +span.command_line_argument_switch { + color: #5BA382; +} + +span.this_value { + color: #a30707; +} + +span.element { + color: #89bdff; + font-size: 0.9em; +} + +span.attribute_name, +span.comment { + color: #9c9c9c; + font-style: italic; + font-size: 0.9em; +} + +span.comment a { + color: #6391c3; + text-decoration: none; +} + +span.comment.bold { + color: gray; +} + +span.javadoc_param_name { + color: #c5c5c5; +} + +span.javadoc_param_annotation { + color: #9c9c9c; + text-decoration: underline; +} + +span.element_value { + /*font-size: 1.15em;*/ + /*color: #E2642F;*/ +} + +span.attribute_value { + color: blue; +} + +span.command_line_argument_placeholder { + color: #9c9c9c; +} diff --git a/jekyll-www.mock-server.com/_sass/_styles.scss b/jekyll-www.mock-server.com/_sass/_styles.scss index 5512df67c..51a39328c 100644 --- a/jekyll-www.mock-server.com/_sass/_styles.scss +++ b/jekyll-www.mock-server.com/_sass/_styles.scss @@ -1,79 +1,85 @@ body { - color: #000; - min-width: 345px; + color: #000; + min-width: 345px; } /* This is the parent `
` that contains the menu and the content area. */ #layout { - padding-left: 200px; /* left col width "#menu" */ - left: 0; + padding-left: 200px; /* left col width "#menu" */ + left: 0; } /* The content `
` is where all your content goes. */ .content { - margin: 0 auto; - padding: 0 2em; - max-width: 1500px; - line-height: 1.6em; + margin: 0 auto; + padding: 0 2em; + max-width: 1500px; + line-height: 1.6em; } .header { - margin: 0; - color: #333; - text-align: center; - padding: 2.5em 2em 0; - border-bottom: 1px solid #eee; + margin: 0; + color: #333; + text-align: center; + padding: 2.5em 2em 0; + border-bottom: 1px solid #eee; } .header h1 { - margin: 0.2em 0; - font-weight: 300; - font: 4em 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; + margin: 0.2em 0; + font-weight: 300; + font: 4em 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; } .header h2 { - font-weight: 300; - color: #ccc; - padding: 0; - margin-top: 0; + font-weight: 300; + color: #ccc; + padding: 0; + margin-top: 0; } .page_header { - margin: 0; - text-align: center; - padding: 2.5em 2em 0; - border-bottom: 1px solid #eee; + margin: 0; + text-align: center; + padding: 2.5em 2em 0; + border-bottom: 1px solid #eee; } .page_header h1 { - margin: 0.2em 0; - font: 4em 'Averia Sans Libre', 'Gloria Hallelujah', 'Indie Flower', Helvetica, Arial, sans-serif; + margin: 0.2em 0; + font: 4em 'Averia Sans Libre', 'Gloria Hallelujah', 'Indie Flower', Helvetica, Arial, sans-serif; } .footer { - display: block; - overflow: hidden; - padding-top: 55px; - padding-bottom: 30px; -// font: 1em 'Indie Flower', 'Lato', sans-serif; - font: 1em 'Lato', sans-serif; - color: #ccc + display: block; + overflow: hidden; + padding-top: 55px; + padding-bottom: 30px; + // font: 1em 'Indie Flower', 'Lato', sans-serif; + font: 1em 'Lato', sans-serif; + color: #ccc } .footer .left { - float: left + float: left } .footer .right { - float: right + float: right } .footer a { - text-decoration: none + text-decoration: none +} + +a img.action_image { + max-width: 600px; + width: 75%; + padding-left: 10%; } /* @@ -84,25 +90,25 @@ By using the combination of `position: fixed; top: 0; bottom:0;`, we can make the menu have 100% height and be fixed on the page as the rest of it scrolls. */ #menu { - margin-left: -200px; /* this should be "#menu" width */ - width: 200px; - position: fixed; - top: 0; - left: 200px; /* this should be "#menu" width */ - bottom: 0; - z-index: 1; /* so the menu or its navicon stays above all content */ - background: #191818; - overflow-y: auto; - -webkit-overflow-scroll: touch; /* for smooth scrolling on mobile */ + margin-left: -200px; /* this should be "#menu" width */ + width: 200px; + position: fixed; + top: 0; + left: 200px; /* this should be "#menu" width */ + bottom: 0; + z-index: 1; /* so the menu or its navicon stays above all content */ + background: #191818; + overflow-y: auto; + -webkit-overflow-scroll: touch; /* for smooth scrolling on mobile */ } /* All anchors inside the menu should be styled like this. */ #menu li a { - color: #999; - border: none; - padding: 0.6em 0 0.6em 0.6em; + color: #999; + border: none; + padding: 0.6em 0 0.6em 0.6em; } /* @@ -110,8 +116,8 @@ Remove all background/borders, since we are applying them to #menu. */ #menu .pure-menu, #menu .pure-menu ul { - border: none; - background: transparent; + border: none; + background: transparent; } /* @@ -127,13 +133,13 @@ Change color of the anchor links on hover/focus. */ #menu .pure-menu li a:hover, #menu .pure-menu li a:focus { - background: #fff; - color: #000; + background: #fff; + color: #000; } #menu #siteMapLink a { - padding: 0; - color: #fff; + padding: 0; + color: #fff; } /* @@ -141,14 +147,14 @@ Change color of the anchor links on hover/focus. */ #menu #siteMapLink:hover, #menu #siteMapLink:focus { - background: #999; + background: #999; } #menu #siteMapLink:hover a, #menu #siteMapLink:focus a { - background: #999; - color: #111; - font-weight: 900; + background: #999; + color: #111; + font-weight: 900; } /* @@ -156,39 +162,39 @@ This styles the selected menu item `
  • `. */ #menu .pure-menu-selected, #menu .pure-menu-heading { - padding-left: 5px; - border-bottom: 1px solid #333; + padding-left: 5px; + border-bottom: 1px solid #333; } #menu div:not(:first-of-type) .pure-menu-selected, #menu div:not(:first-of-type) .pure-menu-heading { - border-top: 1px solid #333; + border-top: 1px solid #333; } #menu div:first-of-type .pure-menu-selected:first-of-type, #menu div:first-of-type .pure-menu-heading:first-of-type { - margin-top: 5px; + margin-top: 5px; } #menu div:last-of-type li:last-of-type { - margin-bottom: 25px; + margin-bottom: 25px; } /* This styles a link within a selected menu item `
  • `. */ #menu .pure-menu-selected a { - color: #fff; + color: #fff; } /* This styles the menu heading. */ #menu .pure-menu-heading { - font: 110% 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; - color: #ffffff; - padding: 10px 10px; - margin: 0; + font: 110% 'Averia Sans Libre', 'Helvetica Neue', Helvetica, Arial, sans-serif; + color: #ffffff; + padding: 10px 10px; + margin: 0; } /* -- Dynamic Button For Responsive Menu -------------------------------------*/ @@ -197,61 +203,61 @@ This styles the menu heading. `.menu-link` represents the responsive menu toggle that shows/hides on small screens. */ #menuLink { - display: none; /* show this only on small screens */ - top: 0; - left: 200px; /* `#menu`'s width */ - background: #000; - font-size: 10px; /* change this value to increase/decrease button size */ - z-index: 10; - width: 2em; - height: auto; - padding: 2.2em 1.6em; + display: none; /* show this only on small screens */ + top: 0; + left: 200px; /* `#menu`'s width */ + background: #000; + font-size: 10px; /* change this value to increase/decrease button size */ + z-index: 10; + width: 2em; + height: auto; + padding: 2.2em 1.6em; } #menuLink:hover, #menuLink:focus { - background: #000; + background: #000; } #menuLink span { - position: relative; - display: block; + position: relative; + display: block; } #menuLink span, #menuLink span:before, #menuLink span:after { - background-color: #fff; - width: 100%; - height: 0.2em; + background-color: #fff; + width: 100%; + height: 0.2em; } #menuLink span:before, #menuLink span:after { - position: absolute; - margin-top: -0.6em; - content: " "; + position: absolute; + margin-top: -0.6em; + content: " "; } #menuLink span:after { - margin-top: 0.6em; + margin-top: 0.6em; } h2 { - margin: .83em 0; - font: 2em 'Averia Sans Libre', 'Gloria Hallelujah', 'Indie Flower', Helvetica, Arial, sans-serif; + margin: .83em 0; + font: 2em 'Averia Sans Libre', 'Gloria Hallelujah', 'Indie Flower', Helvetica, Arial, sans-serif; } a.anchor, a.anchor:hover, a.anchor:active, a.anchor:focus { - display: block; - margin-bottom: 10px; - text-decoration: none; - border: 0 none; - outline: 0; - cursor: default; + display: block; + margin-bottom: 10px; + text-decoration: none; + border: 0 none; + outline: 0; + cursor: default; } a img, @@ -259,158 +265,45 @@ a:hover img, a:active img, a:focus img, a.no_link { - text-decoration: none; - border: 0 none; - outline: 0; - cursor: default; - color: black; + text-decoration: none; + border: 0 none; + outline: 0; + cursor: default; + color: black; } .build_tag { - float: right; - overflow: hidden; + float: right; + overflow: hidden; } pre { - white-space: pre; - word-wrap: normal !important; + white-space: pre; + word-wrap: normal !important; } ul, ol { - margin-left: 1%; - padding-left: 1%; + margin-left: 1%; + padding-left: 1%; } ul.sublist { - margin: 0 1%; + margin: 0 1%; } ul pre, ol pre { - margin-right: 7%; - padding-right: 7%; -} - -.code { - display: block; - white-space: pre; - overflow: auto; - width: 95%; - margin: 1em auto; - padding: 1%; - background-color: #0f0101; - color: #F1F1F1; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - -o-border-radius: 8px; - -ms-border-radius: 8px; - -khtml-border-radius: 8px; - border-radius: 8px; - font-family: Menlo, Monaco, "Courier New", monospace; - font-size: 1em; - border: 1px solid #888; -} - -.inline { - display: inline; - white-space: pre; - word-wrap: normal; - overflow: auto; - margin: 0; - line-height: 3.5em; -} - -.xml { - color: #C9C9C9; -} - -span.keyword { - color: #5B93DA; -} - -span.annotation { - color: #bdb76b; -} - -span.inline_code { - color: #2b2b2b; - font-size: 1.1em; - font-weight: bolder; -} - -span.numeric_literal { - color: #008dff; -} - -span.final, -span.constant { - color: #e28964; - font-style: italic; -} - -span.ruby_constant { - color: #e28964; -} - -span.string_literal, -span.command_line_argument_switch { - color: #5BA382; -} - -span.this_value { - color: #a30707; -} - -span.element { - color: #89bdff; - font-size: 0.9em; -} - -span.attribute_name, -span.comment { - color: #9c9c9c; - font-style: italic; - font-size: 0.9em; -} - -span.comment a { - color: #6391c3; - text-decoration: none; -} - -span.comment.bold { - color: gray; -} - -span.javadoc_param_name { - color: #c5c5c5; -} - -span.javadoc_param_annotation { - color: #9c9c9c; - text-decoration: underline; -} - -span.element_value { - /*font-size: 1.15em;*/ - /*color: #E2642F;*/ -} - -span.attribute_value { - color: blue; -} - -span.command_line_argument_placeholder { - color: #9c9c9c; + margin-right: 7%; + padding-right: 7%; } .sub_title { - margin-top: 3em; - font-weight: bold; + margin-top: 3em; + font-weight: bold; } .sitemap .subsection_subpage { - padding-left: 20px; + padding-left: 20px; } /* -- Responsive Styles (Media Queries) ------------------------------------- */ @@ -420,107 +313,107 @@ Hides the menu at `767px`, but modify this based on your app's needs. */ @media (max-width: 765px) { - html { - font-size: 75%; - } - - .header { - /*text-align: left;*/ - } - - .header h1 { - font-size: 2.5em; - } - - .header h2 { - font-size: 1.25em; - } - - /* Add transition to containers so they can push in and out. */ - #layout, - #menu, - #menuLink { - -webkit-transition: all 0.25s ease-in-out; - -moz-transition: all 0.25s ease-in-out; - -ms-transition: all 0.25s ease-in-out; - -o-transition: all 0.25s ease-in-out; - transition: all 0.25s ease-in-out; - } - - /* - Navigation Push styles. - */ - #layout { - position: relative; - padding-left: 0; - } - - #layout.active { - position: relative; - left: 200px; - } - - #layout.active #menu { - left: 200px; - width: 200px; - } - - #menu { - left: 0; - } - - #menuLink { - float: left; - left: 0; - display: block; /* show the button on small screens */ - } - - #menuLink { - text-decoration: none; - outline: none; - } - - #layout.active #menuLink { - left: 200px; - } - - .build_tag img { - width: 80px; - height: 18px; - } - - a.anchor, a.anchor:hover, a.anchor:active, a.anchor:focus { - margin-bottom: 35px; - } - - ul, ol { - margin-left: 2%; - padding-left: 2%; - } - - .content { - padding: 0 1.5% - } - - .code { - padding: 1%; - font-size: 0.65em; - } + html { + font-size: 75%; + } + + .header { + /*text-align: left;*/ + } + + .header h1 { + font-size: 2.5em; + } + + .header h2 { + font-size: 1.25em; + } + + /* Add transition to containers so they can push in and out. */ + #layout, + #menu, + #menuLink { + -webkit-transition: all 0.25s ease-in-out; + -moz-transition: all 0.25s ease-in-out; + -ms-transition: all 0.25s ease-in-out; + -o-transition: all 0.25s ease-in-out; + transition: all 0.25s ease-in-out; + } + + /* + Navigation Push styles. + */ + #layout { + position: relative; + padding-left: 0; + } + + #layout.active { + position: relative; + left: 200px; + } + + #layout.active #menu { + left: 200px; + width: 200px; + } + + #menu { + left: 0; + } + + #menuLink { + float: left; + left: 0; + display: block; /* show the button on small screens */ + } + + #menuLink { + text-decoration: none; + outline: none; + } + + #layout.active #menuLink { + left: 200px; + } + + .build_tag img { + width: 80px; + height: 18px; + } + + a.anchor, a.anchor:hover, a.anchor:active, a.anchor:focus { + margin-bottom: 35px; + } + + ul, ol { + margin-left: 2%; + padding-left: 2%; + } + + .content { + padding: 0 1.5% + } + + .code { + padding: 1%; + font-size: 0.65em; + } } @media (max-width: 568px) { - .build_tag img { - width: 80px; - height: 18px; - } + .build_tag img { + width: 80px; + height: 18px; + } - ul, ol { - margin-left: 4%; - padding-left: 4%; - } + ul, ol { + margin-left: 4%; + padding-left: 4%; + } - .code { - padding: 2%; - } -} \ No newline at end of file + .code { + padding: 2%; + } +} diff --git a/jekyll-www.mock-server.com/_sass/_syntax-highlighting.scss b/jekyll-www.mock-server.com/_sass/_syntax-highlighting.scss deleted file mode 100644 index 5c1a04702..000000000 --- a/jekyll-www.mock-server.com/_sass/_syntax-highlighting.scss +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Syntax highlighting styles - */ -.highlight { - background: #fff; - margin-bottom: $spacing-unit / 2; - - .c { color: #998; font-style: italic } // Comment - .err { color: #a61717; background-color: #e3d2d2 } // Error - .k { font-weight: bold } // Keyword - .o { font-weight: bold } // Operator - .cm { color: #998; font-style: italic } // Comment.Multiline - .cp { color: #999; font-weight: bold } // Comment.Preproc - .c1 { color: #998; font-style: italic } // Comment.Single - .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special - .gd { color: #000; background-color: #fdd } // Generic.Deleted - .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific - .ge { font-style: italic } // Generic.Emph - .gr { color: #a00 } // Generic.Error - .gh { color: #999 } // Generic.Heading - .gi { color: #000; background-color: #dfd } // Generic.Inserted - .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific - .go { color: #888 } // Generic.Output - .gp { color: #555 } // Generic.Prompt - .gs { font-weight: bold } // Generic.Strong - .gu { color: #aaa } // Generic.Subheading - .gt { color: #a00 } // Generic.Traceback - .kc { font-weight: bold } // Keyword.Constant - .kd { font-weight: bold } // Keyword.Declaration - .kp { font-weight: bold } // Keyword.Pseudo - .kr { font-weight: bold } // Keyword.Reserved - .kt { color: #458; font-weight: bold } // Keyword.Type - .m { color: #099 } // Literal.Number - .s { color: #d14 } // Literal.String - .na { color: #008080 } // Name.Attribute - .nb { color: #0086B3 } // Name.Builtin - .nc { color: #458; font-weight: bold } // Name.Class - .no { color: #008080 } // Name.Constant - .ni { color: #800080 } // Name.Entity - .ne { color: #900; font-weight: bold } // Name.Exception - .nf { color: #900; font-weight: bold } // Name.Function - .nn { color: #555 } // Name.Namespace - .nt { color: #000080 } // Name.Tag - .nv { color: #008080 } // Name.Variable - .ow { font-weight: bold } // Operator.Word - .w { color: #bbb } // Text.Whitespace - .mf { color: #099 } // Literal.Number.Float - .mh { color: #099 } // Literal.Number.Hex - .mi { color: #099 } // Literal.Number.Integer - .mo { color: #099 } // Literal.Number.Oct - .sb { color: #d14 } // Literal.String.Backtick - .sc { color: #d14 } // Literal.String.Char - .sd { color: #d14 } // Literal.String.Doc - .s2 { color: #d14 } // Literal.String.Double - .se { color: #d14 } // Literal.String.Escape - .sh { color: #d14 } // Literal.String.Heredoc - .si { color: #d14 } // Literal.String.Interpol - .sx { color: #d14 } // Literal.String.Other - .sr { color: #009926 } // Literal.String.Regex - .s1 { color: #d14 } // Literal.String.Single - .ss { color: #990073 } // Literal.String.Symbol - .bp { color: #999 } // Name.Builtin.Pseudo - .vc { color: #008080 } // Name.Variable.Class - .vg { color: #008080 } // Name.Variable.Global - .vi { color: #008080 } // Name.Variable.Instance - .il { color: #099 } // Literal.Number.Integer.Long -} diff --git a/jekyll-www.mock-server.com/css/main.scss b/jekyll-www.mock-server.com/css/main.scss index 6eca6d945..3e8fc742c 100755 --- a/jekyll-www.mock-server.com/css/main.scss +++ b/jekyll-www.mock-server.com/css/main.scss @@ -47,5 +47,6 @@ $on-laptop: 800px; // Import partials from `sass_dir` (defaults to `_sass`) @import "styles", - "syntax-highlighting" + "prettify", + "accordion" ; diff --git a/jekyll-www.mock-server.com/images/MockServerScenarios.pptx b/jekyll-www.mock-server.com/images/MockServerScenarios.pptx index 96aeeb0be..317a45ea1 100644 Binary files a/jekyll-www.mock-server.com/images/MockServerScenarios.pptx and b/jekyll-www.mock-server.com/images/MockServerScenarios.pptx differ diff --git a/jekyll-www.mock-server.com/images/expectation_callback_action.png b/jekyll-www.mock-server.com/images/expectation_callback_action.png new file mode 100644 index 000000000..ae92f90e1 Binary files /dev/null and b/jekyll-www.mock-server.com/images/expectation_callback_action.png differ diff --git a/jekyll-www.mock-server.com/images/expectation_error_action.png b/jekyll-www.mock-server.com/images/expectation_error_action.png new file mode 100644 index 000000000..fcf78e12d Binary files /dev/null and b/jekyll-www.mock-server.com/images/expectation_error_action.png differ diff --git a/jekyll-www.mock-server.com/images/expectation_forward_action.png b/jekyll-www.mock-server.com/images/expectation_forward_action.png new file mode 100644 index 000000000..5a3011c56 Binary files /dev/null and b/jekyll-www.mock-server.com/images/expectation_forward_action.png differ diff --git a/jekyll-www.mock-server.com/images/expectation_response_action.png b/jekyll-www.mock-server.com/images/expectation_response_action.png new file mode 100644 index 000000000..d31c2cece Binary files /dev/null and b/jekyll-www.mock-server.com/images/expectation_response_action.png differ diff --git a/jekyll-www.mock-server.com/images/retrieve_logs.png b/jekyll-www.mock-server.com/images/retrieve_logs.png new file mode 100644 index 000000000..5f6b3a2b7 Binary files /dev/null and b/jekyll-www.mock-server.com/images/retrieve_logs.png differ diff --git a/jekyll-www.mock-server.com/images/verification.png b/jekyll-www.mock-server.com/images/verification.png new file mode 100644 index 000000000..de452eaa5 Binary files /dev/null and b/jekyll-www.mock-server.com/images/verification.png differ diff --git a/jekyll-www.mock-server.com/index.html b/jekyll-www.mock-server.com/index.html index 48d546dcb..08cfaef5a 100644 --- a/jekyll-www.mock-server.com/index.html +++ b/jekyll-www.mock-server.com/index.html @@ -23,12 +23,37 @@

    What is MockServer

    MockServer can be used for mocking any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc).

    -

    MockServer can:

    +

    When MockServer receives a requests it matches the request against active expectations that have been configured.

    + +

    An expectations defines the action that is taken, for example, a response could be returned.

    + +

    MockServer supports the follow actions:

      -
    • return a "mock" response when a request matches an expectation
    • -
    • forward a request when the request matches an expectation (i.e. a dynamic port forwarding proxy)
    • -
    • execute a callback when a request matches an expectation, allowing the response to be created dynamically
    • -
    • verify requests have been sent (i.e. as a test assertion)
    • +
    • + return a "mock" response when a request matches an expectation +

      Response Action Expectation

      +
    • +
    • + forward a request when the request matches an expectation (i.e. a dynamic port forwarding proxy) +

      Forward Action Expectation

      +
    • +
    • + execute a callback when a request matches an expectation, allowing the response to be created dynamically +

      Callback Action Expectation

      +
    • + +
    • + return an invalid response or close the connection when a request matches an expectation +

      Error Action Expectation

      +
    • +
    • + verify requests have been sent (i.e. as a test assertion) +

      Verification

      +
    • +
    • + retrieve logs, requests or expectations to help debug +

      Retrieve Logs

      +

    What is MockServer Proxy

    diff --git a/jekyll-www.mock-server.com/mock_server/_includes/callback_action_code_examples.html b/jekyll-www.mock-server.com/mock_server/_includes/callback_action_code_examples.html new file mode 100644 index 000000000..49e4787dc --- /dev/null +++ b/jekyll-www.mock-server.com/mock_server/_includes/callback_action_code_examples.html @@ -0,0 +1,2 @@ +static class callback +method / closure callback diff --git a/jekyll-www.mock-server.com/mock_server/_includes/error_action_code_examples.html b/jekyll-www.mock-server.com/mock_server/_includes/error_action_code_examples.html new file mode 100644 index 000000000..8ffc01097 --- /dev/null +++ b/jekyll-www.mock-server.com/mock_server/_includes/error_action_code_examples.html @@ -0,0 +1,2 @@ +error +error with delay diff --git a/jekyll-www.mock-server.com/mock_server/_includes/forward_action_code_examples.html b/jekyll-www.mock-server.com/mock_server/_includes/forward_action_code_examples.html new file mode 100644 index 000000000..87ec6e009 --- /dev/null +++ b/jekyll-www.mock-server.com/mock_server/_includes/forward_action_code_examples.html @@ -0,0 +1,324 @@ +forward exact request +javascript templated forward +javascript templated forward with delay +velocity template forward + +

    The following code examples show how to create different forward actions.

    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .forward(
    +        forward()
    +            .withHost("mock-server.com")
    +            .withPort(80)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForward": {
    +        "host": "mock-server.com",
    +        "port": 80,
    +        "scheme": "HTTP"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForward": {
    +        "host": "mock-server.com",
    +        "port": 80,
    +        "scheme": "HTTP"
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .forward(
    +        forward()
    +            .withHost("mock-server.com")
    +            .withPort(443)
    +            .withScheme(HttpForward.Scheme.HTTPS)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForward": {
    +        "host": "mock-server.com",
    +        "port": 443,
    +        "scheme": "HTTPS"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForward": {
    +        "host": "mock-server.com",
    +        "port": 443,
    +        "scheme": "HTTPS"
    +    }
    +}'
    +
    +
    + +
    + +
    +
    String template = "return {" + System.getProperty("line.separator") +
    +    "    'path' : \"/somePath\"," + System.getProperty("line.separator") +
    +    "    'queryStringParameters' : {" + System.getProperty("line.separator") +
    +    // request.queryStringParameters['userId'] returns an array of values for the 'userId' query parameter
    +    "        'userId' : request.queryStringParameters && request.queryStringParameters['userId']" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'headers' : {" + System.getProperty("line.separator") +
    +    "        'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'body': JSON.stringify({'name': 'value'})" + System.getProperty("line.separator") +
    +    "};";
    +
    +new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .forward(
    +        template(
    +            HttpTemplate.TemplateType.JAVASCRIPT,
    +            template
    +        )
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "return {\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'queryStringParameters' : {\n" +
    +        "        'userId' : request.queryStringParameters && request.queryStringParameters['userId']\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'body': JSON.stringify({'name': 'value'})\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "return {\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'queryStringParameters' : {\n" +
    +        "        'userId' : request.queryStringParameters && request.queryStringParameters['userId']\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'body': JSON.stringify({'name': 'value'})\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT"
    +    }
    +}'
    +
    +
    + +
    + +
    +
    String template = "return {" + System.getProperty("line.separator") +
    +    "    'path' : \"/somePath\"," + System.getProperty("line.separator") +
    +    "    'cookies' : {" + System.getProperty("line.separator") +
    +    "        'SessionId' : request.cookies && request.cookies['SessionId']" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'headers' : {" + System.getProperty("line.separator") +
    +    "        'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'keepAlive' : true," + System.getProperty("line.separator") +
    +    "    'secure' : true," + System.getProperty("line.separator") +
    +    "    'body' : \"some_body\"" + System.getProperty("line.separator") +
    +    "};";
    +
    +new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .forward(
    +        template(HttpTemplate.TemplateType.JAVASCRIPT)
    +            .withTemplate(template)
    +            .withDelay(TimeUnit.SECONDS, 20)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "return {\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'cookies' : {\n" +
    +        "        'SessionId' : request.cookies && request.cookies['SessionId']\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'keepAlive' : true,\n" +
    +        "    'secure' : true,\n" +
    +        "    'body' : \"some_body\"\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT",
    +        "delay": {"timeUnit": "SECONDS", "value": 20}
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "return {\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'cookies' : {\n" +
    +        "        'SessionId' : request.cookies && request.cookies['SessionId']\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'keepAlive' : true,\n" +
    +        "    'secure' : true,\n" +
    +        "    'body' : \"some_body\"\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT",
    +        "delay": {"timeUnit": "SECONDS", "value": 20}
    +    }
    +}'
    +
    +
    + +
    + +
    +
    String template = "{" + System.getProperty("line.separator") +
    +    "    'path' : \"/somePath\"," + System.getProperty("line.separator") +
    +    "    'queryStringParameters' : {" + System.getProperty("line.separator") +
    +    // $!request.queryStringParameters['userId'] returns an array of values for the 'userId' query parameter
    +    "        'userId' : [ \"$!request.queryStringParameters['userId'][0]\" ]" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'cookies' : {" + System.getProperty("line.separator") +
    +    "        'SessionId' : \"$!request.cookies['SessionId']\"" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'headers' : {" + System.getProperty("line.separator") +
    +    "        'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") +
    +    "    }," + System.getProperty("line.separator") +
    +    "    'body': \"{'name': 'value'}\"" + System.getProperty("line.separator") +
    +    "}";
    +
    +new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .forward(
    +        template(
    +            HttpTemplate.TemplateType.VELOCITY,
    +            template
    +        )
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "{\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'queryStringParameters' : {\n" +
    +        "        'userId' : [ \"$!request.queryStringParameters['userId'][0]\" ]\n" +
    +        "    },\n" +
    +        "    'cookies' : {\n" +
    +        "        'SessionId' : \"$!request.cookies['SessionId']\"\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'body': \"{'name': 'value'}\"\n" +
    +        "}",
    +        "templateType": "VELOCITY"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpForwardTemplate": {
    +        "template": "{\n" +
    +        "    'path' : \"/somePath\",\n" +
    +        "    'queryStringParameters' : {\n" +
    +        "        'userId' : [ \"$!request.queryStringParameters['userId'][0]\" ]\n" +
    +        "    },\n" +
    +        "    'cookies' : {\n" +
    +        "        'SessionId' : \"$!request.cookies['SessionId']\"\n" +
    +        "    },\n" +
    +        "    'headers' : {\n" +
    +        "        'Host' : [ \"localhost:1081\" ]\n" +
    +        "    },\n" +
    +        "    'body': \"{'name': 'value'}\"\n" +
    +        "}",
    +        "templateType": "VELOCITY"
    +    }
    +}'
    +
    +
    diff --git a/jekyll-www.mock-server.com/mock_server/_includes/matcher_code_examples.html b/jekyll-www.mock-server.com/mock_server/_includes/matcher_code_examples.html new file mode 100644 index 000000000..1157e6ec5 --- /dev/null +++ b/jekyll-www.mock-server.com/mock_server/_includes/matcher_code_examples.html @@ -0,0 +1,1180 @@ +

    The following code examples show how to match against different elements of a request using different matchers.

    +

    More complex request matchers can be created by combining the code examples below.

    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some/path"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path"),
    +        Times.exactly(2)
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    },
    +    "times": {
    +        "remainingTimes": 2,
    +        "unlimited": false
    +    },
    +    "timeToLive": {
    +        "unlimited": true
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some/path"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  },
    +  "times" : {
    +    "remainingTimes" : 2,
    +    "unlimited" : false
    +  },
    +  "timeToLive" : {
    +    "unlimited" : true
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path"),
    +        Times.once(),
    +        TimeToLive.exactly(TimeUnit.SECONDS, 60L)
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    },
    +    "times": {
    +        "remainingTimes": 1,
    +        "unlimited": false
    +    },
    +    "timeToLive": {
    +        "timeUnit": "SECONDS",
    +        "timeToLive": 60,
    +        "unlimited": false
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some/path"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  },
    +  "times" : {
    +    "remainingTimes" : 1,
    +    "unlimited" : false
    +  },
    +  "timeToLive" : {
    +    "timeUnit" : "SECONDS",
    +    "timeToLive" : 60,
    +    "unlimited" : false
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            // matches any requests those path starts with "/some"
    +            .withPath("/some.*")
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +// matches any requests those path starts with "/some"
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some.*"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some.*"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            // matches any requests those path does NOT start with "/some"
    +            .withPath(not("/some.*"))
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +// matches any requests those path does NOT start with "/some"
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "!/some.*"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "!/some.*"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            // matches any requests that does NOT have a "GET" method
    +            .withMethod(not("GET"))
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +// matches any requests that does NOT have a "GET" method
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "!GET"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "method" : "!GET"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withMethod("GET")
    +            .withPath("/some/path")
    +            .withHeaders(
    +                header("Accept", "application/json"),
    +                header("Accept-Encoding", "gzip, deflate, br")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "GET",
    +        "path": "/some/path",
    +        "headers": {
    +            "Accept": ["application/json"],
    +            "Accept-Encoding": ["gzip, deflate, br"]
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "method" : "GET",
    +    "path" : "/some/path",
    +    "headers" : {
    +      "Accept" : [ "application/json" ],
    +      "Accept-Encoding" : [ "gzip, deflate, br" ]
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +            .withHeaders(
    +                // matches requests that have an Accept header without the value "application/json"
    +                header(string("Accept"), not("application/json")),
    +                // matches requests that have an Accept-Encoding without the substring "gzip"
    +                header(string("Accept-Encoding"), not(".*gzip.*"))
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path",
    +        "headers": {
    +            // matches requests that have an Accept header without the value "application/json"
    +            "Accept": ["!application/json"],
    +            // matches requests that have an Accept-Encoding without the substring "gzip"
    +            "Accept-Encoding": ["!.*gzip.*"]
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some/path",
    +    "headers" : {
    +      "Accept" : [ "!application/json" ],
    +      "Accept-Encoding" : [ "!.*gzip.*" ]
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +            .withHeaders(
    +                // matches requests that do not have either an Accept or an Accept-Encoding header
    +                header(not("Accept")),
    +                header(not("Accept-Encoding"))
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path",
    +        "headers": {
    +            // matches requests that do not have either an Accept or an Accept-Encoding header
    +            "!Accept": [".*"],
    +            "!Accept-Encoding": [".*"]
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "path" : "/some/path",
    +    "headers" : {
    +      "!Accept" : [ ".*" ],
    +      "!Accept-Encoding" : [ ".*" ]
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withMethod("GET")
    +            .withPath("/view/cart")
    +            .withCookies(
    +                cookie("session", "4930456C-C718-476F-971F-CB8E047AB349")
    +            )
    +            .withQueryStringParameters(
    +                param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "GET",
    +        "path": "/view/cart",
    +        "queryStringParameters": {
    +            "cartId": ["055CA455-1DF7-45BB-8535-4F83E7266092"]
    +        },
    +        "cookies": {
    +            "session": "4930456C-C718-476F-971F-CB8E047AB349"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "method" : "GET",
    +    "path" : "/view/cart",
    +    "queryStringParameters" : {
    +      "cartId" : [ "055CA455-1DF7-45BB-8535-4F83E7266092" ]
    +    },
    +    "cookies" : {
    +      "session" : "4930456C-C718-476F-971F-CB8E047AB349"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody("starts_with_.*")
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": "starts_with_.*"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : "starts_with_.*"
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody("我说中国话", Charsets.UTF_16)
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "STRING",
    +            "string": "我说中国话",
    +            "contentType": "text/plain; charset=utf-16"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "STRING",
    +      "string" : "我说中国话",
    +      "contentType" : "text/plain; charset=utf-16"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withMethod("POST")
    +            .withHeaders(
    +                header("Content-Type", "application/x-www-form-urlencoded")
    +            )
    +            .withBody(
    +                params(
    +                    param("email", "joe.blogs@gmail.com"),
    +                    param("password", "secure_Password123")
    +                )
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "POST",
    +        "headers": {
    +            "Content-Type": ["application/x-www-form-urlencoded"]
    +        },
    +        "body": {
    +            "type": "PARAMETERS",
    +            "parameters": {
    +                "email": ["joe.blogs@gmail.com"],
    +                "password": ["secure_Password123"]
    +            }
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "method" : "POST",
    +    "headers" : {
    +      "Content-Type" : [ "application/x-www-form-urlencoded" ]
    +    },
    +    "body" : {
    +      "type" : "PARAMETERS",
    +      "parameters" : {
    +        "email" : [ "joe.blogs@gmail.com" ],
    +        "password" : [ "secure_Password123" ]
    +      }
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            // matches any request with an XML body containing
    +            // an element that matches the XPath expression
    +            .withBody(
    +                xpath("/bookstore/book[price>30]/price")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    +// matches a request with the following body:
    +/*
    +<?xml version="1.0" encoding="ISO-8859-1"?>
    +<bookstore>
    +  <book category="COOKING">
    +    <title lang="en">Everyday Italian</title>
    +    <author>Giada De Laurentiis</author>
    +    <year>2005</year>
    +    <price>30.00</price>
    +  </book>
    +  <book category="CHILDREN">
    +    <title lang="en">Harry Potter</title>
    +    <author>J K. Rowling</author>
    +    <year>2005</year>
    +    <price>29.99</price>
    +  </book>
    +  <book category="WEB">
    +    <title lang="en">Learning XML</title>
    +    <author>Erik T. Ray</author>
    +    <year>2003</year>
    +    <price>31.95</price>
    +  </book>
    +</bookstore>
    + */
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            // matches any request with an XML body containing
    +            // an element that matches the XPath expression
    +            "type": "XPATH",
    +            "xpath": "/bookstore/book[price>30]/price"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    +// matches a request with the following body:
    +/*
    +<?xml version="1.0" encoding="ISO-8859-1"?>
    +<bookstore>
    +  <book category="COOKING">
    +    <title lang="en">Everyday Italian</title>
    +    <author>Giada De Laurentiis</author>
    +    <year>2005</year>
    +    <price>30.00</price>
    +  </book>
    +  <book category="CHILDREN">
    +    <title lang="en">Harry Potter</title>
    +    <author>J K. Rowling</author>
    +    <year>2005</year>
    +    <price>29.99</price>
    +  </book>
    +  <book category="WEB">
    +    <title lang="en">Learning XML</title>
    +    <author>Erik T. Ray</author>
    +    <year>2003</year>
    +    <price>31.95</price>
    +  </book>
    +</bookstore>
    + */
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "XPATH",
    +      "xpath" : "/bookstore/book[price>30]/price"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                // matches any request with an XML body that does NOT
    +                // contain an element that matches the XPath expression
    +                not(xpath("/bookstore/book[price>30]/price"))
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            // matches any request with an XML body that does NOT
    +            // contain an element that matches the XPath expression
    +            "not": true,
    +            "type": "XPATH",
    +            "xpath": "/bookstore/book[price>30]/price"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "not" : true,
    +      "type" : "XPATH",
    +      "xpath" : "/bookstore/book[price>30]/price"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                xml("<bookstore>" + System.lineSeparator() +
    +                    "   <book nationality=\"ITALIAN\" category=\"COOKING\">" + System.lineSeparator() +
    +                    "       <title lang=\"en\">Everyday Italian</title>" + System.lineSeparator() +
    +                    "       <author>Giada De Laurentiis</author>" + System.lineSeparator() +
    +                    "       <year>2005</year>" + System.lineSeparator() +
    +                    "       <price>30.00</price>" + System.lineSeparator() +
    +                    "   </book>" + System.lineSeparator() +
    +                    "</bookstore>")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "XML",
    +            "xml":  "<bookstore>\n" +
    +                    "   <book nationality=\"ITALIAN\" category=\"COOKING\">\n" +
    +                    "       <title lang=\"en\">Everyday Italian</title>\n" +
    +                    "       <author>Giada De Laurentiis</author>\n" +
    +                    "       <year>2005</year>\n" +
    +                    "       <price>30.00</price>\n" +
    +                    "   </book>\n" +
    +                    "</bookstore>"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "XML",
    +      "xml" : "<bookstore> <book nationality=\"ITALIAN\" category=\"COOKING\"><title lang=\"en\">Everyday Italian</title><author>Giada De Laurentiis</author><year>2005</year><price>30.00</price></book> </bookstore>"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                xmlSchema("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + System.lineSeparator() +
    +                    "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" attributeFormDefault=\"unqualified\">" + System.lineSeparator() +
    +                    "    <!-- XML Schema Generated from XML Document on Wed Jun 28 2017 21:52:45 GMT+0100 (BST) -->" + System.lineSeparator() +
    +                    "    <!-- with XmlGrid.net Free Online Service http://xmlgrid.net -->" + System.lineSeparator() +
    +                    "    <xs:element name=\"notes\">" + System.lineSeparator() +
    +                    "        <xs:complexType>" + System.lineSeparator() +
    +                    "            <xs:sequence>" + System.lineSeparator() +
    +                    "                <xs:element name=\"note\" maxOccurs=\"unbounded\">" + System.lineSeparator() +
    +                    "                    <xs:complexType>" + System.lineSeparator() +
    +                    "                        <xs:sequence>" + System.lineSeparator() +
    +                    "                            <xs:element name=\"to\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>" + System.lineSeparator() +
    +                    "                            <xs:element name=\"from\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>" + System.lineSeparator() +
    +                    "                            <xs:element name=\"heading\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>" + System.lineSeparator() +
    +                    "                            <xs:element name=\"body\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>" + System.lineSeparator() +
    +                    "                        </xs:sequence>" + System.lineSeparator() +
    +                    "                    </xs:complexType>" + System.lineSeparator() +
    +                    "                </xs:element>" + System.lineSeparator() +
    +                    "            </xs:sequence>" + System.lineSeparator() +
    +                    "        </xs:complexType>" + System.lineSeparator() +
    +                    "    </xs:element>" + System.lineSeparator() +
    +                    "</xs:schema>")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "XML_SCHEMA",
    +            "xmlSchema": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" attributeFormDefault=\"unqualified\">\n" +
    +            "    <!-- XML Schema Generated from XML Document on Wed Jun 28 2017 21:52:45 GMT+0100 (BST) -->\n" +
    +            "    <!-- with XmlGrid.net Free Online Service http://xmlgrid.net -->\n" +
    +            "    <xs:element name=\"notes\">\n" +
    +            "        <xs:complexType>\n" +
    +            "            <xs:sequence>\n" +
    +            "                <xs:element name=\"note\" maxOccurs=\"unbounded\">\n" +
    +            "                    <xs:complexType>\n" +
    +            "                        <xs:sequence>\n" +
    +            "                            <xs:element name=\"to\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>\n" +
    +            "                            <xs:element name=\"from\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>\n" +
    +            "                            <xs:element name=\"heading\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>\n" +
    +            "                            <xs:element name=\"body\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element>\n" +
    +            "                        </xs:sequence>\n" +
    +            "                    </xs:complexType>\n" +
    +            "                </xs:element>\n" +
    +            "            </xs:sequence>\n" +
    +            "        </xs:complexType>\n" +
    +            "    </xs:element>\n</xs:schema>"
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "XML_SCHEMA",
    +      "xmlSchema" : "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" attributeFormDefault=\"unqualified\"> <xs:element name=\"notes\"> <xs:complexType> <xs:sequence> <xs:element name=\"note\" maxOccurs=\"unbounded\"> <xs:complexType> <xs:sequence> <xs:element name=\"to\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element> <xs:element name=\"from\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element> <xs:element name=\"heading\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element> <xs:element name=\"body\" minOccurs=\"1\" maxOccurs=\"1\" type=\"xs:string\"></xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                xmlSchemaFromResource("org/mockserver/examples/mockserver/testXmlSchema.xsd")
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                json("{" + System.lineSeparator() +
    +                        "    \"id\": 1," + System.lineSeparator() +
    +                        "    \"name\": \"A green door\"," + System.lineSeparator() +
    +                        "    \"price\": 12.50," + System.lineSeparator() +
    +                        "    \"tags\": [\"home\", \"green\"]" + System.lineSeparator() +
    +                        "}",
    +                    MatchType.STRICT
    +                )
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withStatusCode(HttpStatusCode.ACCEPTED_202.code())
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "JSON",
    +            "json": JSON.stringify({
    +                "id": 1,
    +                "name": "A green door",
    +                "price": 12.50,
    +                "tags": ["home", "green"]
    +            }),
    +            "matchType": "STRICT"
    +        }
    +    },
    +    "httpResponse": {
    +        "statusCode": 202,
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "JSON",
    +      "json" : "{ \"id\": 1, \"name\": \"A green door\", \"price\": 12.50, \"tags\": [\"home\", \"green\"] }",
    +      "matchType" : "STRICT"
    +    }
    +  },
    +  "httpResponse" : {
    +    "statusCode" : 202,
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                json("{" + System.lineSeparator() +
    +                        "    \"id\": 1," + System.lineSeparator() +
    +                        "    \"name\": \"A green door\"," + System.lineSeparator() +
    +                        "    \"price\": 12.50," + System.lineSeparator() +
    +                        "    \"tags\": [\"home\", \"green\"]" + System.lineSeparator() +
    +                        "}",
    +                    MatchType.ONLY_MATCHING_FIELDS
    +                )
    +            )
    +    )
    +    .respond(
    +        response()
    +            .withStatusCode(HttpStatusCode.ACCEPTED_202.code())
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "JSON",
    +            "json": JSON.stringify({
    +                "id": 1,
    +                "name": "A green door",
    +                "price": 12.50,
    +                "tags": ["home", "green"]
    +            })
    +        }
    +    },
    +    "httpResponse": {
    +        "statusCode": 202,
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "JSON",
    +      "json" : "{ \"id\": 1, \"name\": \"A green door\", \"price\": 12.50, \"tags\": [\"home\", \"green\"] }"
    +    }
    +  },
    +  "httpResponse" : {
    +    "statusCode" : 202,
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withBody(
    +                jsonSchema("{" + System.lineSeparator() +
    +                    "    \"$schema\": \"http://json-schema.org/draft-04/schema#\"," + System.lineSeparator() +
    +                    "    \"title\": \"Product\"," + System.lineSeparator() +
    +                    "    \"description\": \"A product from Acme's catalog\"," + System.lineSeparator() +
    +                    "    \"type\": \"object\"," + System.lineSeparator() +
    +                    "    \"properties\": {" + System.lineSeparator() +
    +                    "        \"id\": {" + System.lineSeparator() +
    +                    "            \"description\": \"The unique identifier for a product\"," + System.lineSeparator() +
    +                    "            \"type\": \"integer\"" + System.lineSeparator() +
    +                    "        }," + System.lineSeparator() +
    +                    "        \"name\": {" + System.lineSeparator() +
    +                    "            \"description\": \"Name of the product\"," + System.lineSeparator() +
    +                    "            \"type\": \"string\"" + System.lineSeparator() +
    +                    "        }," + System.lineSeparator() +
    +                    "        \"price\": {" + System.lineSeparator() +
    +                    "            \"type\": \"number\"," + System.lineSeparator() +
    +                    "            \"minimum\": 0," + System.lineSeparator() +
    +                    "            \"exclusiveMinimum\": true" + System.lineSeparator() +
    +                    "        }," + System.lineSeparator() +
    +                    "        \"tags\": {" + System.lineSeparator() +
    +                    "            \"type\": \"array\"," + System.lineSeparator() +
    +                    "            \"items\": {" + System.lineSeparator() +
    +                    "                \"type\": \"string\"" + System.lineSeparator() +
    +                    "            }," + System.lineSeparator() +
    +                    "            \"minItems\": 1," + System.lineSeparator() +
    +                    "            \"uniqueItems\": true" + System.lineSeparator() +
    +                    "        }" + System.lineSeparator() +
    +                    "    }," + System.lineSeparator() +
    +                    "    \"required\": [\"id\", \"name\", \"price\"]" + System.lineSeparator() +
    +                    "}"))
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "body": {
    +            "type": "JSON_SCHEMA",
    +            "jsonSchema": JSON.stringify({
    +                "$schema": "http://json-schema.org/draft-04/schema#",
    +                "title": "Product",
    +                "description": "A product from Acme's catalog",
    +                "type": "object",
    +                "properties": {
    +                    "id": {
    +                        "description": "The unique identifier for a product",
    +                        "type": "integer"
    +                    },
    +                    "name": {
    +                        "description": "Name of the product",
    +                        "type": "string"
    +                    },
    +                    "price": {
    +                        "type": "number",
    +                        "minimum": 0,
    +                        "exclusiveMinimum": true
    +                    },
    +                    "tags": {
    +                        "type": "array",
    +                        "items": {
    +                            "type": "string"
    +                        },
    +                        "minItems": 1,
    +                        "uniqueItems": true
    +                    }
    +                },
    +                "required": ["id", "name", "price"]
    +            })
    +        }
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +  "httpRequest" : {
    +    "body" : {
    +      "type" : "JSON_SCHEMA",
    +      "jsonSchema" : "{\"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\": \"Product\", \"description\": \"A product from Acme's catalog\", \"type\": \"object\", \"properties\": { \"id\": { \"description\": \"The unique identifier for a product\", \"type\": \"integer\" }, \"name\": { \"description\": \"Name of the product\", \"type\": \"string\"}, \"price\": { \"type\": \"number\", \"minimum\": 0, \"exclusiveMinimum\": true }, \"tags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"minItems\": 1, \"uniqueItems\": true } }, \"required\": [\"id\", \"name\", \"price\"] }"
    +    }
    +  },
    +  "httpResponse" : {
    +    "body" : "some_response_body"
    +  }
    +}'
    +
    +
    diff --git a/jekyll-www.mock-server.com/mock_server/_includes/request_matchers_summary.html b/jekyll-www.mock-server.com/mock_server/_includes/request_matchers_summary.html index 179d595a7..ffb86f199 100644 --- a/jekyll-www.mock-server.com/mock_server/_includes/request_matchers_summary.html +++ b/jekyll-www.mock-server.com/mock_server/_includes/request_matchers_summary.html @@ -1,27 +1,24 @@
      -
    • path - plain text or regular expression
    • -
    • query string - plain text or regular expression
    • -
    • headers - plain text or regular expression
    • -
    • cookies - plain text or regular expression
    • -
    • body - XPath, JSON, JSON Schema, regular expression, plain text (exact match), or body parameters
    • +
    • method - plain text or regular expression
    • +
    • path - plain text or regular expression
    • +
    • query string - plain text or regular expression
    • +
    • headers - plain text or regular expression
    • +
    • cookies - plain text or regular expression
    • +
    • body +
        +
      • XPath
      • +
      • XML
      • +
      • XML Schema
      • +
      • JSON - supports two match types STRICT and ONLY_MATCHING_FIELDS. STRICT match type matches all fields and the order of arrays. In STRICT match type extra fields will cause the matcher to fail. ONLY_MATCHING_FIELDS match type only matches fields provided in the request matcher.
      • +
      • JSON Schema
      • +
      • regular expression
      • +
      • plain text (i.e. exact match)
      • +
      • form fields (i.e. body parameters)
      • +
      +
    • secure - true if the request was made using HTTPS
    -

    The body can be matched using plain text, a JSON object, a JSON schema, an XPath expression or a regular expression

    +NOT -

    JSON expressions

    - -

    A JSON expression is a valid JSON object. When a JSON expression is matched against a request body the order of the fields will be ignored, if the exact order is important use a plain text or regular expression matcher.

    - -

    The JSON expression supports two match types STRICT and ONLY_MATCHING_FIELDS. STRICT match type matches all fields and the order of arrays. In STRICT match type extra fields will cause the matcher to fail. ONLY_MATCHING_FIELDS match type only matches fields provided in the body for the request matcher. ONLY_MATCHING_FIELDS match type will match correctly against a request that contains additional fields or a request that contains any array fields those elements are in a different order.

    - -

    JSON Schema

    - -

    For detail of the support JSON Schema syntax see json-schema.org.

    - -

    XPath

    - -

    For detail of the support XPath syntax see XPath Expression Syntax.

    - -

    Regular Expressions

    - -

    All other matching can be done using plain text or a regular expression, see Pattern (Java Platform SE 6) for supported regular expression syntax.

    \ No newline at end of file +

    All matchers for the fields above can also be negated, even the entire request matcher can be negated. When a matched is negated anything except what is specified in the matcher is matched.

    +

    For example if a path matcher for "/some/path" is negated by adding a "!" at the start (as follows "!/some/path") then any path except "/some/path" is matched.

    diff --git a/jekyll-www.mock-server.com/mock_server/_includes/response_action_code_examples.html b/jekyll-www.mock-server.com/mock_server/_includes/response_action_code_examples.html new file mode 100644 index 000000000..71beca706 --- /dev/null +++ b/jekyll-www.mock-server.com/mock_server/_includes/response_action_code_examples.html @@ -0,0 +1,457 @@ +

    The following code examples show how to create different response actions.

    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    // this request matcher matches every request
    +    .when(
    +        request()
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    // if no request matcher is specified then every request matched
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +});
    +
    + +
    +
    # if no request matcher is specified then every request matched
    +curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpResponse": {
    +        "body": "some_response_body"
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    // this request matcher matches every request
    +    .when(
    +        request()
    +    )
    +    .respond(
    +        response()
    +            .withHeader(
    +                CONTENT_TYPE.toString(),
    +                MediaType.create("text", "plain").withCharset(Charsets.UTF_16).toString()
    +            )
    +            .withBody("我说中国话".getBytes(Charsets.UTF_16))
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    // if no request matcher is specified then every request matched
    +    "httpResponse": {
    +        "headers": {
    +            "content-type": ["text/plain; charset=utf-16"]
    +        },
    +        "body": {
    +            "type": "BINARY",
    +            "base64Bytes": "/v9iEYv0Ti1W/Yvd"
    +        }
    +    }
    +});
    +
    + +
    +
    # if no request matcher is specified then every request matched
    +curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpResponse": {
    +        "headers": {
    +            "content-type": ["text/plain; charset=utf-16"]
    +        },
    +        "body": {
    +            "type": "BINARY",
    +            "base64Bytes": "/v9iEYv0Ti1W/Yvd"
    +        }
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withMethod("POST")
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        response()
    +            .withStatusCode(200)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "POST",
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "statusCode": 200
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "method": "POST",
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "statusCode": 200
    +    }
    +}'
    +
    +
    + +
    + +
    +
    byte[] pngBytes = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("org/mockserver/examples/mockserver/test.png"));
    +new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/ws/rest/user/[0-9]+/icon/[0-9]+\\.png")
    +    )
    +    .respond(
    +        response()
    +            .withStatusCode(HttpStatusCode.OK_200.code())
    +            .withHeaders(
    +                header(CONTENT_TYPE.toString(), MediaType.PNG.toString()),
    +                header(CONTENT_DISPOSITION.toString(), "form-data; name=\"test.png\"; filename=\"test.png\"")
    +            )
    +            .withBody(binary(pngBytes))
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/ws/rest/user/[0-9]+/icon/[0-9]+\\.png"
    +    },
    +    "httpResponse": {
    +        "statusCode": 200,
    +        "headers": {
    +            "content-type": ["image/png"],
    +            "content-disposition": ["form-data; name=\"test.png\"; filename=\"test.png\""]
    +        },
    +        "body": {
    +            "type": "BINARY",
    +            "base64Bytes": "iVBORw0KGgoAAAANSUhEUgAAAqwAAAAp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AEXADQL/D4BaqFLDMQVOAAAAAElFTkSuQmCC"
    +        }
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/ws/rest/user/[0-9]+/icon/[0-9]+\\.png"
    +    },
    +    "httpResponse": {
    +        "statusCode": 200,
    +        "headers": {
    +            "content-type": ["image/png"],
    +            "content-disposition": ["form-data; name=\"test.png\"; filename=\"test.png\""]
    +        },
    +        "body": {
    +            "type": "BINARY",
    +            "base64Bytes": "iVBORw0KGgoAAAANSUhEUgAAAqwAAAApCAIAAAB/QuwlAAAK+GlDQ1BJQ0MgUHJvZmlsZQAASA2tl3dcU8kWx+fe9EYLICAl9CZIr9JrAAXpYCMkgYQSYgoCVpTFFVwLKiKgrugiiIJrAWQtiAULoljAvkEWFXVdLIiKypvAEvfzPm//e5PP3Pne35w598zcmXzOBYBGZQmFWagKANkCiSg6xJ+RmJTMIDwGWKAF8EAf2LHYYqFfVFQE+NfyoRcg8s5bNnJf/2r2vztUOVwxGwAkCnancsTsbMjHYH3PFookAGDqoG68RCKUcxdkdREMELJMzumT/F7OqROMJU7YxEYHAIDVBYBIZbFE6QBQLaDOyGWnQz/UUMh2Ag5fADkPsjebx+JAboU8Izs7R85/QLZI/Yef9H8wi5Wq8MlipSt4ci5wJHxwIF8szGLlT9z8Py/ZWVK4XhPFEF6pPFFoNGwT4ZpVZ+aEK1iQOidySufDGU0xTxoaN8VscQBcy8mxHFZg+BRLM+P8ppglgvS3DV/CjJ1iUU60wr8ga458f0zEwOMyFcwVB8VM6Wn8YOYUF/BiE6Y4lx8/Z4rFmTGKGAp4AQpdJI1WxJwmClbMMVsMR/79XDbr+7MkvFj5O56Ih8MNDJpiriBOEY9Q4q/wI8ya2N8T9tysEIUuzo1RjJWIYhV6BitMvl8n7IWSKMWagEDAB2IgBFmABfIBAyyB9xLAg5QGcoAIsAEXcOBdNAgB/rDNhioHagxgAYLgaCasDKjlQk0Ef/yJXksJNw/uWw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mHxEQ8x9PJakm0EMAkZH6ta7q+2teMx5//auchEektxXlRx8HiOBMqygCFAGKAEWAInA3I3BbHsTdDAztG0WAIkARoAhQBO52BKgTcLePMO0fRYAiQBGgCFAE3CBAnQA3wNBiigBFgCJAEaAI3O0IUCfgbh9h2j+KAEWAIkARoAi4QYA6AW6AocUUAYoARYAiQBG42xGgTsDdPsK0fxQBigBFgCJAEXCDAHUC3ABDiykCFAGKAEWAInC3I0CdgLt9hGn/KAIUAYoARYAi4AYB6gS4AYYWUwQoAhQBigBF4G5HgDoBd/sI0/5RBCgCFAGKAEXADQL/D4BaqFLDMQVOAAAAAElFTkSuQmCC"
    +        }
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        response()
    +            .withBody("some_response_body")
    +            .withDelay(TimeUnit.SECONDS, 10)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body",
    +        "delay": {
    +            "timeUnit": "SECONDS",
    +            "value": 10
    +        }
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponse": {
    +        "body": "some_response_body",
    +        "delay": {
    +            "timeUnit": "SECONDS",
    +            "value": 10
    +        }
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        template(
    +            HttpTemplate.TemplateType.JAVASCRIPT,
    +            "return {" + System.getProperty("line.separator") +
    +                "     'statusCode': 200," + System.getProperty("line.separator") +
    +                "     'cookies': {" + System.getProperty("line.separator") +
    +                "          'session' : request.headers['session-id'][0]" + System.getProperty("line.separator") +
    +                "     }," + System.getProperty("line.separator") +
    +                "     'headers': {" + System.getProperty("line.separator") +
    +                "          'Date' : Date()" + System.getProperty("line.separator") +
    +                "     }," + System.getProperty("line.separator") +
    +                "     'body': JSON.stringify(" + System.getProperty("line.separator") +
    +                "               {" + System.getProperty("line.separator") +
    +                "                    method: request.method," + System.getProperty("line.separator") +
    +                "                    path: request.path," + System.getProperty("line.separator") +
    +                "                    body: request.body" + System.getProperty("line.separator") +
    +                "               }" + System.getProperty("line.separator") +
    +                "          )" + System.getProperty("line.separator") +
    +                "};"
    +        )
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponseTemplate": {
    +        "template": "return {\n" +
    +        "     'statusCode': 200,\n" +
    +        "     'cookies': {\n" +
    +        "          'session' : request.headers['session-id'][0]\n" +
    +        "     },\n" +
    +        "     'headers': {\n" +
    +        "          'Date' : Date()\n" +
    +        "     },\n" +
    +        "     'body': JSON.stringify(\n" +
    +        "               {\n" +
    +        "                    method: request.method," +
    +        "                    path: request.path," +
    +        "                    body: request.body" +
    +        "               }\n" +
    +        "          )\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {
    +        "path": "/some/path"
    +    },
    +    "httpResponseTemplate": {
    +        "template": "return {\n" +
    +        "     'statusCode': 200,\n" +
    +        "     'cookies': {\n" +
    +        "          'session' : request.headers['session-id'][0]\n" +
    +        "     },\n" +
    +        "     'headers': {\n" +
    +        "          'Date' : Date()\n" +
    +        "     },\n" +
    +        "     'body': JSON.stringify(\n" +
    +        "               {\n" +
    +        "                    method: request.method," +
    +        "                    path: request.path," +
    +        "                    body: request.body" +
    +        "               }\n" +
    +        "          )\n" +
    +        "};",
    +        "templateType": "JAVASCRIPT"
    +    }
    +}'
    +
    +
    + +
    + +
    +
    String template = "" +
    +    "if (request.method === 'POST' && request.path === '/somePath') {" + System.getProperty("line.separator") +
    +    "    return {" + System.getProperty("line.separator") +
    +    "        'statusCode': 200," + System.getProperty("line.separator") +
    +    "        'body': JSON.stringify({name: 'value'})" + System.getProperty("line.separator") +
    +    "    };" + System.getProperty("line.separator") +
    +    "} else {" + System.getProperty("line.separator") +
    +    "    return {" + System.getProperty("line.separator") +
    +    "        'statusCode': 406," + System.getProperty("line.separator") +
    +    "        'body': request.body" + System.getProperty("line.separator") +
    +    "    };" + System.getProperty("line.separator") +
    +    "}";
    +
    +new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        template(HttpTemplate.TemplateType.JAVASCRIPT)
    +            .withTemplate(template)
    +            .withDelay(TimeUnit.MINUTES, 2)
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {"path": "/some/path"},
    +    "httpResponseTemplate": {
    +        "template": "if (request.method === 'POST' && request.path === '/somePath') {\n" +
    +        "    return {\n" +
    +        "        'statusCode': 200,\n" +
    +        "        'body': JSON.stringify({name: 'value'})\n" +
    +        "    };\n" +
    +        "} else {\n" +
    +        "    return {\n" +
    +        "        'statusCode': 406,\n" +
    +        "        'body': request.body\n" +
    +        "    };\n" +
    +        "}",
    +        "templateType": "JAVASCRIPT",
    +        "delay": {"timeUnit": "MINUTES", "value": 2}
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {"path": "/some/path"},
    +    "httpResponseTemplate": {
    +        "template": "if (request.method === 'POST' && request.path === '/somePath') {\n" +
    +        "    return {\n" +
    +        "        'statusCode': 200,\n" +
    +        "        'body': JSON.stringify({name: 'value'})\n" +
    +        "    };\n" +
    +        "} else {\n" +
    +        "    return {\n" +
    +        "        'statusCode': 406,\n" +
    +        "        'body': request.body\n" +
    +        "    };\n" +
    +        "}",
    +        "templateType": "JAVASCRIPT",
    +        "delay": {"timeUnit": "MINUTES", "value": 2}
    +    }
    +}'
    +
    +
    + +
    + +
    +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withPath("/some/path")
    +    )
    +    .respond(
    +        template(
    +            HttpTemplate.TemplateType.VELOCITY,
    +            "{" + System.getProperty("line.separator") +
    +                "     \"statusCode\": 200," + System.getProperty("line.separator") +
    +                "     \"cookies\": { " + System.getProperty("line.separator") +
    +                "          \"session\": \"$!request.headers['Session-Id'][0]\"" + System.getProperty("line.separator") +
    +                "     }," + System.getProperty("line.separator") +
    +                "     \"headers\": {" + System.getProperty("line.separator") +
    +                "          \"Client-User-Agent\": [ \"$!request.headers['User-Agent'][0]\" ]" + System.getProperty("line.separator") +
    +                "     }," + System.getProperty("line.separator") +
    +                "     \"body\": $!request.body" + System.getProperty("line.separator") +
    +                "}"
    +        )
    +    );
    +
    + +
    +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {"path": "/some/path"},
    +    "httpResponseTemplate": {
    +        "template": "{\n" +
    +        "     \"statusCode\": 200,\n" +
    +        "     \"cookies\": {\n" +
    +        "           \"session\": \"$!request.headers['Session-Id'][0]\"\n" +
    +        "      },\n" +
    +        "     \"headers\": {\n" +
    +        "           \"Client-User-Agent\": [ \"$!request.headers['User-Agent'][0]\" ]\n" +
    +        "      },\n" +
    +        "     \"body\": $!request.body\n" +
    +        "}",
    +        "templateType": "VELOCITY"
    +    }
    +});
    +
    + +
    +
    curl -v -X PUT "http://localhost:1080/expectation" -d '{
    +    "httpRequest": {"path": "/some/path"},
    +    "httpResponseTemplate": {
    +        "template": "{\n" +
    +        "     \"statusCode\": 200,\n" +
    +        "     \"cookies\": {\n" +
    +        "           \"session\": \"$!request.headers['Session-Id'][0]\"\n" +
    +        "      },\n" +
    +        "     \"headers\": {\n" +
    +        "           \"Client-User-Agent\": [ \"$!request.headers['User-Agent'][0]\" ]\n" +
    +        "      },\n" +
    +        "     \"body\": $!request.body\n" +
    +        "}",
    +        "templateType": "VELOCITY"
    +    }
    +}'
    +
    +
    diff --git a/jekyll-www.mock-server.com/mock_server/creating_expectations_java_request_matchers.html b/jekyll-www.mock-server.com/mock_server/creating_expectations_java_request_matchers.html index b1f301963..2bc63a63d 100644 --- a/jekyll-www.mock-server.com/mock_server/creating_expectations_java_request_matchers.html +++ b/jekyll-www.mock-server.com/mock_server/creating_expectations_java_request_matchers.html @@ -6,243 +6,7 @@ subsection: false --- -

    To specify a request matcher in Java use the org.mockserver.model.HttpRequest class which specifies the details of each HTTP response with a fluent API:

    - -
    public class HttpRequest {
    -
    -    /**
    -     * The HTTP method to match on such as "GET" or "POST"
    -     *
    -     * @param method the HTTP method such as "GET" or "POST"
    -     */
    -    public HttpRequest withMethod(String method);
    -
    -    /**
    -     * The HTTP method all method except a specific value using the "not" operator,
    -     * for example this allows operations such as not("GET")
    -     *
    -     * @param method the HTTP method to not match on not("GET") or not("POST")
    -     */
    -    public HttpRequest withMethod(NottableString method);
    -
    -    /**
    -     * The path to match on such as "/some_mocked_path" any servlet context path is ignored for matching and should not be specified here
    -     * regex values are also supported such as ".*_path", see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
    -     * for full details of the supported regex syntax
    -     *
    -     * @param path the path such as "/some_mocked_path" or a regex
    -     */
    -    public HttpRequest withPath(String path);
    -
    -    /**
    -     * The path to not match on for example not("/some_mocked_path") with match any path not equal to "/some_mocked_path",
    -     * the servlet context path is ignored for matching and should not be specified here
    -     * regex values are also supported such as not(".*_path"), see
    -     * http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html for full details of the supported regex syntax
    -     *
    -     * @param path the path to not match on such as not("/some_mocked_path") or not(".*_path")
    -     */
    -    public HttpRequest withPath(NottableString path);
    -
    -    /**
    -     * The query string parameters to match on as a list of Parameter objects where the values or keys of each parameter
    -     * can be either a string or a regex (for more details of the supported regex syntax
    -     * see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param parameters the list of Parameter objects where the values or keys of each parameter can be either a string or a regex
    -     */
    -    public HttpRequest withQueryStringParameters(List<Parameter> parameters);
    -
    -    /**
    -     * The query string parameters to match on as a varags Parameter objects where the values or keys of each parameter
    -     * can be either a string or a regex (for more details of the supported regex syntax
    -     * see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param parameters the varags Parameter objects where the values or keys of each parameter can be either a string or a regex
    -     */
    -    public HttpRequest withQueryStringParameters(Parameter... parameters);
    -
    -    /**
    -     * The query string parameters to match on as a Map<String, List<String>> where the values or keys of each parameter
    -     * can be either a string or a regex (for more details of the supported regex syntax
    -     * see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param parameters the Map<String, List<String>> object where the values or keys of each parameter can be either a string or a regex
    -     */
    -    public HttpRequest withQueryStringParameters(Map<String, List<String>> parameters);
    -
    -    /**
    -     * Adds one query string parameter to match on as a Parameter object where the parameter values list can be a list of strings
    -     * or regular expressions (for more details of the supported regex syntax
    -     * see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param parameter the Parameter object which can have a values list of strings or regular expressions
    -     */
    -    public HttpRequest withQueryStringParameter(Parameter parameter);
    -
    -    /**
    -     * Adds one query string parameter to match on as a Parameter object where the parameter values list can be a list of strings
    -     * or regular expressions (for more details of the supported regex syntax
    -     * see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param name the parameter name
    -     * @param values the parameter values which can be a varags of strings or regular expressions
    -     */
    -    public HttpRequest withQueryStringParameter(String name, String... values);
    -
    -    /**
    -     * The exact string body to match on such as "this is an exact string body"
    -     *
    -     * @param body the body on such as "this is an exact string body"
    -     */
    -    public HttpRequest withBody(String body);
    -
    -    /**
    -     * The body match rules on such as using one of the Body subclasses as follows:
    -     *
    -     * exact string match:
    -     *
    -     *   - exact("this is an exact string body");
    -     *
    -     *  or
    -     *
    -     *   - new StringBody("this is an exact string body")
    -     *
    -     * regular expression match:
    -     *
    -     *   - regex("username[a-z]{4}");
    -     *
    -     *  or
    -     *
    -     *   - new RegexBody("username[a-z]{4}");
    -     *
    -     * json match:
    -     *
    -     *   - json("{username: 'foo', password: 'bar'}");
    -     *
    -     *   or
    -     *
    -     *   - json("{username: 'foo', password: 'bar'}", MatchType.STRICT);
    -     *
    -     *   or
    -     *
    -     *   - new JsonBody("{username: 'foo', password: 'bar'}");
    -     *
    -     * json schema match:
    -     *
    -     *   - jsonSchema("{type: 'object', properties: { 'username': { 'type': 'string' }, 'password': { 'type': 'string' } }, 'required': ['username', 'password']}");
    -     *
    -     *   or
    -     *
    -     *   - jsonSchemaFromResource("org/mockserver/model/loginSchema.json");
    -     *
    -     *   or
    -     *
    -     *   - new JsonSchemaBody("{type: 'object', properties: { 'username': { 'type': 'string' }, 'password': { 'type': 'string' } }, 'required': ['username', 'password']}");
    -     *
    -     * xpath match:
    -     *
    -     *   - xpath("/element[key = 'some_key' and value = 'some_value']");
    -     *
    -     *  or
    -     *
    -     *   - new XPathBody("/element[key = 'some_key' and value = 'some_value']");
    -     *
    -     * body parameter match:
    -     *
    -     *   - params(
    -     *             param("name_one", "value_one_one", "value_one_two")
    -     *             param("name_two", "value_two")
    -     *     );
    -     *
    -     *  or
    -     *
    -     *   - new ParameterBody(
    -     *             new Parameter("name_one", "value_one_one", "value_one_two")
    -     *             new Parameter("name_two", "value_two")
    -     *     );
    -     *
    -     * binary match:
    -     *
    -     *   - binary(IOUtils.readFully(getClass().getClassLoader().getResourceAsStream("example.pdf"), 1024));
    -     *
    -     *  or
    -     *
    -     *   - new BinaryBody(IOUtils.readFully(getClass().getClassLoader().getResourceAsStream("example.pdf"), 1024));
    -     *
    -     * for more details of the supported regular expression syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
    -     * for more details of the supported json syntax see http://jsonassert.skyscreamer.org
    -     * for more details of the supported json schema syntax see http://json-schema.org/
    -     * for more detail of XPath syntax see http://saxon.sourceforge.net/saxon6.5.3/expressions.html
    -     *
    -     * @param body an instance of one of the Body subclasses including StringBody or ParameterBody
    -     */
    -    public HttpRequest withBody(Body body);
    -
    -    /**
    -     * The headers to match on as a list of Header objects where the values or keys of each header can be either a string or a regex
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param headers the list of Header objects where the values or keys of each header can be either a string or a regex
    -     */
    -    public HttpRequest withHeaders(List<Header> headers);
    -    /**
    -     * The headers to match on as a varags of Header objects  where the values or keys of each header can be either a string or a regex
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param headers the varags of Header objects where the values or keys of each header can be either a string or a regex
    -     */
    -    public HttpRequest withHeaders(Header... headers);
    -
    -    /**
    -     * Adds one header to match on as a Header object where the header values list can be a list of strings or regular expressions
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param header the Header object which can have a values list of strings or regular expressions
    -     */
    -    public HttpRequest withHeader(Header header);
    -
    -    /**
    -     * Adds one header to match on as a Header object where the header values list can be a list of strings or regular expressions
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param name the header name
    -     * @param values the header values which can be a varags of strings or regular expressions
    -     */
    -    public HttpRequest withHeader(String name, String... values);
    -
    -    /**
    -     * The cookies to match on as a list of Cookie objects  where the values or keys of each cookie can be either a string or a regex
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param cookies the list of Cookie objects where the values or keys of each cookie can be either a string or a regex
    -     */
    -    public HttpRequest withCookies(List<Cookie> cookies);
    -    /**
    -     * The cookies to match on as a varags Cookie objects where the values or keys of each cookie can be either a string or a regex
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param cookies the varags Cookie objects where the values or keys of each cookie can be either a string or a regex
    -     */
    -    public HttpRequest withCookies(Cookie... cookies);
    -
    -    /**
    -     * Adds one cookie to match on as a Cookie object where the cookie values list can be a list of strings or regular expressions
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param cookie the Cookie object which can have a values list of strings or regular expressions
    -     */
    -    public HttpRequest withCookie(Cookie cookie);
    -
    -    /**
    -     * Adds one cookie to match on as a Cookie object where the cookie values list can be a list of strings or regular expressions
    -     * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
    -     *
    -     * @param name the cookies name
    -     * @param value the cookies value which can be a string or regular expression
    -     */
    -    public HttpRequest withCookie(String name, String value);
    -}
    +

    To specify a request matcher in Java use the org.mockserver.model.HttpRequest class which specifies the details of each HTTP response with a fluent API.

    For example:

    diff --git a/jekyll-www.mock-server.com/mock_server/creating_expectations_java_response_actions.html b/jekyll-www.mock-server.com/mock_server/creating_expectations_java_response_actions.html index a7c98ee0d..3807a91ff 100644 --- a/jekyll-www.mock-server.com/mock_server/creating_expectations_java_response_actions.html +++ b/jekyll-www.mock-server.com/mock_server/creating_expectations_java_response_actions.html @@ -24,169 +24,9 @@ ); -

    The full specification of org.mockserver.model.HttpResponse is as follows:

    - -
    public class HttpResponse {
    -
    -    /**
    -     * The status code to return, such as 200, 404, the status code specified
    -     * here will result in the default status message for this status code for
    -     * example for 200 the status message "OK" is used
    -     *
    -     * @param statusCode an integer such as 200 or 404
    -     */
    -    public HttpResponse withStatusCode(Integer responseCode);
    -
    -    /**
    -     * The cookies to return as Set-Cookie headers as a list of Cookie objects
    -     *
    -     * @param cookies a list of Cookie objects
    -     */
    -    public HttpResponse withCookies(List<Cookie> cookies);
    -    /**
    -     * The cookies to return as Set-Cookie headers as a varargs of Cookie objects
    -     *
    -     * @param cookies a varargs of Cookie objects
    -     */
    -    public HttpResponse withCookies(Cookie... cookies);
    -
    -    /**
    -     * Add cookie to return as Set-Cookie header
    -     *
    -     * @param cookie a Cookie object
    -     */
    -    public HttpResponse withCookie(Cookie cookie);
    -
    -    /**
    -     * Add cookie to return as Set-Cookie header
    -     *
    -     * @param name the cookies name
    -     * @param value the cookies value which can be a string or regular expression
    -     */
    -    public HttpResponse withCookie(String name, String value);
    -
    -    /**
    -     * The headers to return as a list of Header objects
    -     *
    -     * @param headers a list of Header objects
    -     */
    -    public HttpResponse withHeaders(List<Header> headers);
    -    /**
    -     * The headers to return as a varargs of Header objects
    -     *
    -     * @param headers a varargs of Header objects
    -     */
    -    public HttpResponse withHeaders(Header... headers);
    -
    -    /**
    -     * A header to return as a Header objects
    -     *
    -     * @param header a Header objects
    -     */
    -    public HttpResponse withHeader(Header header)
    -
    -    /**
    -     * A header to return as a Header objects
    -     *
    -     * @param name the header name
    -     * @param values the header values which can be a varags of strings or regular expressions
    -     */
    -    public HttpResponse withHeader(String name, String... values)
    -
    -    /**
    -     * Set response body to return as a simple UTF-8 string response body
    -     *
    -     * @param body a "UTF-8" string
    -     */
    -    public HttpResponse withBody(String body);
    -
    -    /**
    -     * * Set response body to return as binary such as a pdf or image
    -     *
    -     * @param body a byte array
    -     */
    -    public HttpResponse withBody(byte[] body);
    -
    -    /**
    -     * Set the body to return for example:
    -     *
    -     * string body:
    -     *   - exact("<html><head/><body><div>a simple string body</div></body></html>"); or
    -     *   - new StringBody("<html><head/><body><div>a simple string body</div></body></html>")
    -     *
    -     * binary body:
    -     *   - binary(IOUtils.readFully(getClass().getClassLoader().getResourceAsStream("example.pdf"), 1024)); or
    -     *   - new BinaryBody(IOUtils.readFully(getClass().getClassLoader().getResourceAsStream("example.pdf"), 1024));
    -     *
    -     * @param body an instance of one of the Body subclasses including StringBody or BinaryBody
    -     */
    -    public HttpResponse withBody(Body body);
    -
    -    /**
    -     * The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
    -     *
    -     * @param delay a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
    -     */
    -    public HttpResponse withDelay(Delay delay);
    -
    -    /**
    -     * The connection options for override the default connection behaviour, this allows full control of headers such
    -     * as "Connection" or "Content-Length" or controlling whether the socket is closed after the response has been sent
    -     *
    -     * @param connectionOptions the connection options for override the default connection behaviour
    -     */
    -    public HttpResponse withConnectionOptions(ConnectionOptions connectionOptions);
    -}
    -   -

    To control whether the socket is closed after the response has been sent or headers such as "Connection" or "Content-Length" the org.mockserver.model.ConnectionOptions class can be used, as follows:

    - -
    public class ConnectionOptions {
    -
    -    /**
    -     * Prevent a "Content-Length" header from being added to the response
    -     *
    -     * @param suppressContentLengthHeader if true no "Content-Length" header will be added to the response
    -     */
    -    public ConnectionOptions withSuppressContentLengthHeader(Boolean suppressContentLengthHeader);
    -
    -    /**
    -     * Override the "Content-Length" header with the specified amount, if not set the "Content-Length"
    -     * header will have a value determined by the length of the body
    -     *
    -     * @param contentLengthHeaderOverride the value to use for the "Content-Length" header
    -     */
    -    public ConnectionOptions withContentLengthHeaderOverride(Integer contentLengthHeaderOverride);
    -
    -    /**
    -     * Prevent a "Connection" header from being added to the response
    -     *
    -     * @param suppressConnectionHeader if true no "Connection" header will be added to the response
    -     */
    -    public ConnectionOptions withSuppressConnectionHeader(Boolean suppressConnectionHeader);
    -
    -    /**
    -     * Override the "Connection" header:
    -     *    if true the "Connection" header is specified with a value of "keep-alive"
    -     *    if false the "Connection" header is specified with a value of "close"
    -     *    if not set the "Connection" header will have a a value of "close" unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"
    -     *
    -     * @param keepAliveOverride if true "keep-alive" is used if false "close" is used for the "Connection" header
    -     */
    -    public ConnectionOptions withKeepAliveOverride(Boolean keepAliveOverride);
    -
    -    /**
    -     * Override whether the socket is closed after a response is sent:
    -     *    if true the socket will always be closed,
    -     *    if false the socket will never be closed,
    -     *    if not set the socket will be closed unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"
    -     *
    -     * @param closeSocket set whether the socket is closed after a response is sent
    -     */
    -    public ConnectionOptions withCloseSocket(Boolean closeSocket);
    -
    -}
    +

    To control whether the socket is closed after the response has been sent or headers such as "Connection" or "Content-Length" the org.mockserver.model.ConnectionOptions class can be used.

    For example:

    @@ -204,4 +44,4 @@ .withKeepAliveOverride(true) .withCloseSocket(true) ); - \ No newline at end of file + diff --git a/jekyll-www.mock-server.com/mock_server/getting_started.html b/jekyll-www.mock-server.com/mock_server/getting_started.html index 554f4e26f..6c9662383 100644 --- a/jekyll-www.mock-server.com/mock_server/getting_started.html +++ b/jekyll-www.mock-server.com/mock_server/getting_started.html @@ -31,261 +31,179 @@

    0. Start MockServer

    1. Setup Expectations

    -

    To mock an HTTP / HTTPS interaction an expectation is setup specifying how a request should be matched and what action MockServer should take when the request has been matched.

    - -

    When a request is matched there are three actions that can be defined as follows:

    + +
    +

    Please Note: There are over 100 more detailed code examples in Java, JavaScript and the REST API below.

    + +
    new MockServerClient("localhost", 1080)
    +    .when(
    +        request()
    +            .withMethod("POST")
    +            .withPath("/login")
    +            .withBody("{username: 'foo', password: 'bar'}")
    +    )
    +    .respond(
    +        response()
    +            .withStatusCode(302)
    +            .withCookie(
    +                "sessionId", "2By8LOhBmaW5nZXJwcmludCIlMDAzMW"
    +            )
    +            .withHeader(
    +                "Location", "https://www.mock-server.com"
    +            )
    +    );
    +
    + + +
    +

    Please Note: There are over 100 more detailed code examples in Java, JavaScript and the REST API below.

    + +
    var mockServerClient = require('mockserver-client').mockServerClient;
    +mockServerClient("localhost", 1080).mockAnyResponse({
    +    "httpRequest": {
    +        "method": "POST",
    +        "path": "/login",
    +        "body": "{username: 'foo', password: 'bar'}"
    +    },
    +    "httpResponse": {
    +        "statusCode": 302,
    +        "headers": {
    +            "Location" : [ "https://www.mock-server.com" ]
    +        },
    +        "cookies": {
    +            "sessionId" : "2By8LOhBmaW5nZXJwcmludCIlMDAzMW"
    +        }
    +    }
    +});
    +
    +

    An expectation contains:

      -
    • respond - return a "mock" response
    • -
    • forward - forward the request
    • -
    • callback - execute a callback
    • +
    • request matcher - used to match which requests this expectation should be applied to
    • +
    • action - what action to take, actions include response, forward, callback and error
    • +
    • times - how many times the action should be taken
    • +
    • timeToLive - how long the expectation should stay active
    -  - -

    Java Examples

    - -

    The following Java example shows the creation of an simple expectation with a respond action:

    - -
    new MockServerClient("localhost", 1080)
    -        .when(
    -                request()
    -                        .withMethod("POST")
    -                        .withPath("/login")
    -                        .withBody("{username: 'foo', password: 'bar'}")
    -        )
    -        .respond(
    -                response()
    -                        .withStatusCode(302)
    -                        .withCookie(
    -                                "sessionId", "2By8LOhBmaW5nZXJwcmludCIlMDAzMW"
    -                        )
    -                        .withHeader(
    -                                "Location", "https://www.mock-server.com"
    -                        )
    -        );
    - -

    The following Java example shows the creation of a more complex expectation with a respond action:

    - -
    new MockServerClient("localhost", 1080)
    -        .when(
    -                request()
    -                        .withMethod("POST")
    -                        .withPath("/login")
    -                        .withQueryStringParameters(
    -                                new Parameter("returnUrl", "/account"),
    -                                new Parameter("_timestamp", "1430199066291")
    -                        )
    -                        .withCookie("sessionId", "2By8LOhBmaW5nZXJwcmludCIlMDAzMW")
    -                        .withBody(json("{username: 'foo', password: 'bar'}", MatchType.STRICT)),
    -                Times.exactly(1),
    -                TimeToLive.exactly(TimeUnit.MINUTES, 5l)
    -        )
    -        .respond(
    -                response()
    -                        .withStatusCode(401)
    -                        .withHeaders(
    -                                new Header("Content-Type", "application/json; charset=utf-8"),
    -                                new Header("Cache-Control", "public, max-age=86400")
    -                        )
    -                        .withBody("{ message: 'incorrect username and password combination' }")
    -                        .withDelay(new Delay(TimeUnit.SECONDS, 1))
    -        );
    - -  - -

    JavaScript Examples

    - -

    The following JavaScript example shows the creation of an simple expectation with a respond action:

    - -
    mockServerClient("localhost", 1080).mockAnyResponse({
    -    "httpRequest": {
    -        "method": "POST",
    -        "path": "/login",
    -        "body": "{username: 'foo', password: 'bar'}"
    -    },
    -    "httpResponse": {
    -        "statusCode": 302,
    -        "headers": [
    -            {
    -                "name": "Location",
    -                "values": "https://www.mock-server.com"
    -            }
    -        ],
    -        "cookies": [
    -            {
    -                "name": "sessionId",
    -                "value": "2By8LOhBmaW5nZXJwcmludCIlMDAzMW"
    -            }
    -        ]
    -    }
    -});
    -
    - -

    The following JavaScript example shows the creation of a more complex expectation with a respond action:

    - -
    mockServerClient("localhost", 1080).mockAnyResponse({
    -    "httpRequest": {
    -        "method": "POST",
    -        "path": "/login",
    -        "queryStringParameters": [
    -            {
    -                "name": "returnUrl",
    -                "values": ["/account"]
    -            },
    -            {
    -                "name": "_timestamp",
    -                "values": ["1430199066291"]
    -            }
    -        ],
    -        "cookies": [
    -            {
    -                "name": "sessionId",
    -                "values": ["2By8LOhBmaW5nZXJwcmludCIlMDAzMW"]
    -            }
    -        ],
    -        "body": {
    -            "type": "JSON",
    -            "value": JSON.stringify({ username: "foo", password: "bar" }),
    -            "matchType": "STRICT"
    -        }
    -    },
    -    "httpResponse": {
    -        "statusCode": 401,
    -        "headers": [
    -            {
    -                "name": "Content-Type",
    -                "values": ["application/json; charset=utf-8"]
    -            },
    -            {
    -                "name": "Cache-Control",
    -                "values": ["public, max-age=86400"]
    -            }
    -        ],
    -        "body": JSON.stringify({ message: "incorrect username and password combination" }),
    -        "delay": {
    -            "timeUnit": "SECONDS",
    -            "value": 1
    -        }
    -    },
    -    "times": {
    -        "remainingTimes": 1,
    -        "unlimited": false
    -    },
    -    "timeToLive": {
    -        "timeUnit": "MINUTES,
    -        "timeToLive": 5,
    -        "unlimited": false
    -    }
    -});
    -
    - -

    Ruby Examples

    - -

    The following Ruby example shows the creation of an simple expectation with a respond action:

    - -
    client = MockServerClient.new('localhost', 1080)
    -expectation = expectation do |expectation|
    -     expectation.request do |request|
    -        request.method = 'POST'
    -        request.path = '/login'
    -        request.body = exact({ username: 'foo', password: 'bar' }.to_json)
    -     end
    -
    -    expectation.response do |response|
    -        response.status_code = 302
    -        response.headers << header('Location', 'https://www.mock-server.com')
    -    end
    -end
    -client.register(expectation)
    - -

    The following Ruby example shows the creation of a more complex expectation with a respond action:

    - -
    client = MockServerClient.new('localhost', 1080)
    -expectation = expectation do |expectation|
    -     expectation.request do |request|
    -        request.method = 'POST'
    -        request.path = '/login'
    -        request.query_string_parameters << parameter('returnUrl', '/account')
    -        request.query_string_parameters << parameter('_timestamp', '1430199066291')
    -        request.cookies = [cookie('sessionId', '2By8LOhBmaW5nZXJwcmludCIlMDAzMW')]
    -        request.body = exact({ username: 'foo', password: 'bar' }.to_json)
    -     end
    -
    -    expectation.response do |response|
    -        response.status_code = 401
    -        response.headers << header('Content-Type', 'application/json; charset=utf-8')
    -        response.headers << header('Cache-Control', 'public, max-age=86400')
    -        response.body  = body({ message: 'incorrect username and password combination' }.to_json)
    -        response.delay = delay_by(:SECONDS, 1)
    -    end
    -
    -    expectation.times = exactly(1)
    -end
    -client.register(expectation)
    - -

    Requests can be matched on:

    - -{% include_subpage _includes/request_matchers_summary.html %} - -

    For more details see the section below on creating expectations.

    +  -

    Actions

    +

    Request Matchers

    -

    When a request is matched there are three actions that can occur as follows:

    +

    A request matcher can contain any of the following matchers:

      -
    • respond - return a "mock" response
    • -
    • forward - forward the request
    • -
    • callback - execute a callback
    • +
    • method - string value as a plain text, regular expression or negated matcher
    • +
    • path - string value as a plain text, regular expression or negated matcher
    • +
    • query string - key to multiple values as a plain text, regular expression or negated matcher
    • +
    • headers - key to multiple values as a plain text, regular expression or negated matcher
    • +
    • cookies - key to value as a plain text, regular expression or negated matcher
    • +
    • body + +
    • secure - true if the request was made using HTTPS
    -

    Respond Actions

    +  -

    A response action defines a mock response containing:

    +

    Actions

    +

    Actions can be one of the following types:

      -
    • status code
    • -
    • body
    • -
    • headers
    • -
    • cookies
    • +
    • response - returns a response
    • +
    • forward - forward the request
    • +
    • callback - execute a callback
    • +
    • error - returns an invalid response
    -

    Responses can be further controlled using:

    +

    A response action can be:

    -

    For more details see the section below on creating expectations.

    - -

    Forward Actions

    - -

    A forward action defines how a request should be forwarded and contains:

    +

    A forward action can be:

      -
    • host
    • -
    • port
    • -
    • scheme
    • +
    • +

      either an exact forwarder, that forwards requests exactly as it receives them, containing the following:

      + +
    • +
    • +

      or a templated forwarder using javascript or velocity, with a delay, that allows requests to be modified or completely re-written before they are forwarded

      +
    -

    Only the host is mandatory as the port is defaulted to 80 and the scheme is defaulted to HTTP.

    - -

    For more details see the section below on creating expectations.

    - -

    Callback Actions

    +

    A callback action can be:

    A callback action defines a class that will be used to dynamically generate the response and contains:

      -
    • callbackClass
    • +
    • callbackClass

    The class must define a default constructor and implement org.mockserver.mock.action.ExpectationCallback.

    -

    For more details see the section below on creating expectations.

    +

    callback - execute either a static class callback or an method / closure callback

    + +static class callback +method / closure callback + +

    An error action can be:

    + +

    error - return an invalid response with an optional delay

    + +error +error with delay + +  + +

    Code Examples:

    + +

    Request Matchers

    + +{% include_subpage _includes/matcher_code_examples.html %} + +

    Response Actions

    + +{% include_subpage _includes/response_action_code_examples.html %} + +

    Forward Actions

    + +{% include_subpage _includes/forward_action_code_examples.html %} + +

    Callback Actions

    + +{% include_subpage _includes/callback_action_code_examples.html %} + +

    Error Actions

    + +{% include_subpage _includes/error_action_code_examples.html %}

    3. Verify Requests

    -{% include_subpage _includes/verification_summary.html %} \ No newline at end of file +{% include_subpage _includes/verification_summary.html %} diff --git a/jekyll-www.mock-server.com/scripts/accordion.js b/jekyll-www.mock-server.com/scripts/accordion.js new file mode 100644 index 000000000..e4938b3e0 --- /dev/null +++ b/jekyll-www.mock-server.com/scripts/accordion.js @@ -0,0 +1,40 @@ +var acc = document.getElementsByClassName("accordion"); +for (var i = 0; i < acc.length; i++) { + acc[i].addEventListener("click", function () { + /* Toggle between adding and removing the "active" class, + to highlight the button that controls the panel */ + this.classList.toggle("active"); + + /* Toggle between hiding and showing the active panel */ + var panel = this.nextElementSibling; + if (panel.style.display === "block") { + panel.style.display = "none"; + } else { + panel.style.display = "block"; + } + }); +} + +function locationHashChanged(e) { + if (location.hash.indexOf("#button") !== -1) { + var acc = document.getElementsByClassName("accordion"); + // first close other accordions + for (var i = 0; i < acc.length; i++) { + if (acc[i].classList) { + acc[i].classList.remove("active"); + } + if (acc[i].nextElementSibling) { + acc[i].nextElementSibling.style.display = "none"; + } + } + // then open and scroll into view + var accordionButton = document.getElementById(location.hash.slice(1)); + if (accordionButton) { + accordionButton.classList.remove("active"); + accordionButton.nextElementSibling.style.display = "block"; + accordionButton.scrollIntoView(true); + } + } +} + +window.onhashchange = locationHashChanged; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/BasicMatchingExamples.java b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/BasicMatchingExamples.java new file mode 100644 index 000000000..94838a1b6 --- /dev/null +++ b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/BasicMatchingExamples.java @@ -0,0 +1,437 @@ +package org.mockserver.examples.mockserver; + +import com.google.common.base.Charsets; +import org.mockserver.client.server.MockServerClient; +import org.mockserver.matchers.MatchType; +import org.mockserver.matchers.TimeToLive; +import org.mockserver.matchers.Times; +import org.mockserver.model.HttpStatusCode; + +import java.util.concurrent.TimeUnit; + +import static org.mockserver.model.Cookie.cookie; +import static org.mockserver.model.Header.header; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; +import static org.mockserver.model.JsonBody.json; +import static org.mockserver.model.JsonSchemaBody.jsonSchema; +import static org.mockserver.model.NottableString.not; +import static org.mockserver.model.NottableString.string; +import static org.mockserver.model.Parameter.param; +import static org.mockserver.model.ParameterBody.params; +import static org.mockserver.model.XPathBody.xpath; +import static org.mockserver.model.XmlBody.xml; +import static org.mockserver.model.XmlSchemaBody.xmlSchema; +import static org.mockserver.model.XmlSchemaBody.xmlSchemaFromResource; + +/** + * @author jamesdbloom + */ +public class BasicMatchingExamples { + + public void matchRequestByPath() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByPathExactlyTwice() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path"), + Times.exactly(2) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByPathExactlyOnceInTheNext60Seconds() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path"), + Times.once(), + TimeToLive.exactly(TimeUnit.SECONDS, 60L) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByRegexPath() { + new MockServerClient("localhost", 1080) + .when( + request() + // matches any requests those path starts with "/some" + .withPath("/some.*") + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByNotMatchingPath() { + new MockServerClient("localhost", 1080) + .when( + request() + // matches any requests those path does NOT start with "/some" + .withPath(not("/some.*")) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByNotMatchingMethod() { + new MockServerClient("localhost", 1080) + .when( + request() + // matches any requests that does NOT have a "GET" method + .withMethod(not("GET")) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByHeaders() { + new MockServerClient("localhost", 1080) + .when( + request() + .withMethod("GET") + .withPath("/some/path") + .withHeaders( + header("Accept", "application/json"), + header("Accept-Encoding", "gzip, deflate, br") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByNotMatchingHeaderValue() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + .withHeaders( + // matches requests that have an Accept header without the value "application/json" + header(string("Accept"), not("application/json")), + // matches requests that have an Accept-Encoding without the substring "gzip" + header(string("Accept-Encoding"), not(".*gzip.*")) + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByNotMatchingHeaders() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + .withHeaders( + // matches requests that do not have either an Accept or an Accept-Encoding header + header(not("Accept")), + header(not("Accept-Encoding")) + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByCookiesAndQueryParameters() { + new MockServerClient("localhost", 1080) + .when( + request() + .withMethod("GET") + .withPath("/view/cart") + .withCookies( + cookie("session", "4930456C-C718-476F-971F-CB8E047AB349") + ) + .withQueryStringParameters( + param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByRegexBody() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody("starts_with_.*") + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyInUTF16() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody("我说中国话", Charsets.UTF_16) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithFormSubmission() { + new MockServerClient("localhost", 1080) + .when( + request() + .withMethod("POST") + .withHeaders( + header("Content-Type", "application/x-www-form-urlencoded") + ) + .withBody( + params( + param("email", "joe.blogs@gmail.com"), + param("password", "secure_Password123") + ) + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithXPath() { + new MockServerClient("localhost", 1080) + .when( + request() + // matches any request with an XML body containing + // an element that matches the XPath expression + .withBody( + xpath("/bookstore/book[price>30]/price") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + + // matches a request with the following body: + /* + + + + Everyday Italian + Giada De Laurentiis + 2005 + 30.00 + + + Harry Potter + J K. Rowling + 2005 + 29.99 + + + Learning XML + Erik T. Ray + 2003 + 31.95 + + + */ + } + + public void matchRequestByNotMatchingBodyWithXPath() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + // matches any request with an XML body that does NOT + // contain an element that matches the XPath expression + not(xpath("/bookstore/book[price>30]/price")) + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithXml() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + xml("" + System.lineSeparator() + + " " + System.lineSeparator() + + " Everyday Italian" + System.lineSeparator() + + " Giada De Laurentiis" + System.lineSeparator() + + " 2005" + System.lineSeparator() + + " 30.00" + System.lineSeparator() + + " " + System.lineSeparator() + + "") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithXmlSchema() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + xmlSchema("" + System.lineSeparator() + + "" + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + " " + System.lineSeparator() + + "") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithXmlSchemaByClasspath() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + xmlSchemaFromResource("org/mockserver/examples/mockserver/testXmlSchema.xsd") + ) + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithJsonExactly() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + json("{" + System.lineSeparator() + + " \"id\": 1," + System.lineSeparator() + + " \"name\": \"A green door\"," + System.lineSeparator() + + " \"price\": 12.50," + System.lineSeparator() + + " \"tags\": [\"home\", \"green\"]" + System.lineSeparator() + + "}", + MatchType.STRICT + ) + ) + ) + .respond( + response() + .withStatusCode(HttpStatusCode.ACCEPTED_202.code()) + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithJsonIgnoringExtraFields() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + json("{" + System.lineSeparator() + + " \"id\": 1," + System.lineSeparator() + + " \"name\": \"A green door\"," + System.lineSeparator() + + " \"price\": 12.50," + System.lineSeparator() + + " \"tags\": [\"home\", \"green\"]" + System.lineSeparator() + + "}", + MatchType.ONLY_MATCHING_FIELDS + ) + ) + ) + .respond( + response() + .withStatusCode(HttpStatusCode.ACCEPTED_202.code()) + .withBody("some_response_body") + ); + } + + public void matchRequestByBodyWithJsonSchema() { + new MockServerClient("localhost", 1080) + .when( + request() + .withBody( + jsonSchema("{" + System.lineSeparator() + + " \"$schema\": \"http://json-schema.org/draft-04/schema#\"," + System.lineSeparator() + + " \"title\": \"Product\"," + System.lineSeparator() + + " \"description\": \"A product from Acme's catalog\"," + System.lineSeparator() + + " \"type\": \"object\"," + System.lineSeparator() + + " \"properties\": {" + System.lineSeparator() + + " \"id\": {" + System.lineSeparator() + + " \"description\": \"The unique identifier for a product\"," + System.lineSeparator() + + " \"type\": \"integer\"" + System.lineSeparator() + + " }," + System.lineSeparator() + + " \"name\": {" + System.lineSeparator() + + " \"description\": \"Name of the product\"," + System.lineSeparator() + + " \"type\": \"string\"" + System.lineSeparator() + + " }," + System.lineSeparator() + + " \"price\": {" + System.lineSeparator() + + " \"type\": \"number\"," + System.lineSeparator() + + " \"minimum\": 0," + System.lineSeparator() + + " \"exclusiveMinimum\": true" + System.lineSeparator() + + " }," + System.lineSeparator() + + " \"tags\": {" + System.lineSeparator() + + " \"type\": \"array\"," + System.lineSeparator() + + " \"items\": {" + System.lineSeparator() + + " \"type\": \"string\"" + System.lineSeparator() + + " }," + System.lineSeparator() + + " \"minItems\": 1," + System.lineSeparator() + + " \"uniqueItems\": true" + System.lineSeparator() + + " }" + System.lineSeparator() + + " }," + System.lineSeparator() + + " \"required\": [\"id\", \"name\", \"price\"]" + System.lineSeparator() + + "}")) + ) + .respond( + response() + .withBody("some_response_body") + ); + } +} diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ForwardActionExamples.java b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ForwardActionExamples.java new file mode 100644 index 000000000..b2e50dd55 --- /dev/null +++ b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ForwardActionExamples.java @@ -0,0 +1,125 @@ +package org.mockserver.examples.mockserver; + +import org.mockserver.client.server.MockServerClient; +import org.mockserver.model.HttpForward; +import org.mockserver.model.HttpTemplate; + +import java.util.concurrent.TimeUnit; + +import static org.mockserver.model.HttpForward.forward; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpTemplate.template; + +/** + * @author jamesdbloom + */ +public class ForwardActionExamples { + + public void forwardRequestInHTTP() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .forward( + forward() + .withHost("mock-server.com") + .withPort(80) + ); + } + + public void forwardRequestInHTTPS() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .forward( + forward() + .withHost("mock-server.com") + .withPort(443) + .withScheme(HttpForward.Scheme.HTTPS) + ); + } + + public void javascriptTemplatedForward() { + String template = "return {" + System.getProperty("line.separator") + + " 'path' : \"/somePath\"," + System.getProperty("line.separator") + + " 'queryStringParameters' : {" + System.getProperty("line.separator") + + // request.queryStringParameters['userId'] returns an array of values for the 'userId' query parameter + " 'userId' : request.queryStringParameters && request.queryStringParameters['userId']" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'headers' : {" + System.getProperty("line.separator") + + " 'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'body': JSON.stringify({'name': 'value'})" + System.getProperty("line.separator") + + "};"; + + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .forward( + template( + HttpTemplate.TemplateType.JAVASCRIPT, + template + ) + ); + } + + public void javascriptTemplatedForwardWithDelay() { + String template = "return {" + System.getProperty("line.separator") + + " 'path' : \"/somePath\"," + System.getProperty("line.separator") + + " 'cookies' : {" + System.getProperty("line.separator") + + " 'SessionId' : request.cookies && request.cookies['SessionId']" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'headers' : {" + System.getProperty("line.separator") + + " 'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'keepAlive' : true," + System.getProperty("line.separator") + + " 'secure' : true," + System.getProperty("line.separator") + + " 'body' : \"some_body\"" + System.getProperty("line.separator") + + "};"; + + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .forward( + template(HttpTemplate.TemplateType.JAVASCRIPT) + .withTemplate(template) + .withDelay(TimeUnit.SECONDS, 20) + ); + } + + public void velocityTemplatedForward() { + String template = "{" + System.getProperty("line.separator") + + " 'path' : \"/somePath\"," + System.getProperty("line.separator") + + " 'queryStringParameters' : {" + System.getProperty("line.separator") + + // $!request.queryStringParameters['userId'] returns an array of values for the 'userId' query parameter + " 'userId' : [ \"$!request.queryStringParameters['userId'][0]\" ]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'cookies' : {" + System.getProperty("line.separator") + + " 'SessionId' : \"$!request.cookies['SessionId']\"" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'headers' : {" + System.getProperty("line.separator") + + " 'Host' : [ \"localhost:1081\" ]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'body': \"{'name': 'value'}\"" + System.getProperty("line.separator") + + "}"; + + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .forward( + template( + HttpTemplate.TemplateType.VELOCITY, + template + ) + ); + } +} diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ResponseActionExamples.java b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ResponseActionExamples.java new file mode 100644 index 000000000..a133ca51b --- /dev/null +++ b/mockserver-examples/src/main/java/org/mockserver/examples/mockserver/ResponseActionExamples.java @@ -0,0 +1,189 @@ +package org.mockserver.examples.mockserver; + +import com.google.common.base.Charsets; +import com.google.common.net.MediaType; +import org.apache.commons.io.IOUtils; +import org.mockserver.client.server.MockServerClient; +import org.mockserver.model.HttpStatusCode; +import org.mockserver.model.HttpTemplate; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_DISPOSITION; +import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE; +import static org.mockserver.model.BinaryBody.binary; +import static org.mockserver.model.Header.header; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; +import static org.mockserver.model.HttpTemplate.template; + +/** + * @author jamesdbloom + */ +public class ResponseActionExamples { + + public static void main(String[] args) throws IOException { + new MockServerClient("localhost", 1080).reset(); + ResponseActionExamples responseActionExamples = new ResponseActionExamples(); + responseActionExamples.responseLiteralWithBodyOnly(); + responseActionExamples.responseLiteralWithUTF16BodyResponse(); + responseActionExamples.responseLiteralWithStatusCodeOnly(); + responseActionExamples.responseLiteralWithBinaryPNGBody(); + responseActionExamples.responseLiteralWith10SecondDelay(); + responseActionExamples.javascriptTemplatedResponse(); + responseActionExamples.javascriptTemplatedResponseWithDelay(); + responseActionExamples.velocityTemplatedResponse(); + } + + public void responseLiteralWithBodyOnly() { + new MockServerClient("localhost", 1080) + // this request matcher matches every request + .when( + request() + ) + .respond( + response() + .withBody("some_response_body") + ); + } + + public void responseLiteralWithUTF16BodyResponse() { + new MockServerClient("localhost", 1080) + // this request matcher matches every request + .when( + request() + ) + .respond( + response() + .withHeader( + CONTENT_TYPE.toString(), + MediaType.create("text", "plain").withCharset(Charsets.UTF_16).toString() + ) + .withBody("我说中国话".getBytes(Charsets.UTF_16)) + ); + } + + public void responseLiteralWithStatusCodeOnly() { + new MockServerClient("localhost", 1080) + .when( + request() + .withMethod("POST") + .withPath("/some/path") + ) + .respond( + response() + .withStatusCode(200) + ); + } + + public void responseLiteralWithBinaryPNGBody() throws IOException { + byte[] pngBytes = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("org/mockserver/examples/mockserver/test.png")); + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/ws/rest/user/[0-9]+/icon/[0-9]+\\.png") + ) + .respond( + response() + .withStatusCode(HttpStatusCode.OK_200.code()) + .withHeaders( + header(CONTENT_TYPE.toString(), MediaType.PNG.toString()), + header(CONTENT_DISPOSITION.toString(), "form-data; name=\"test.png\"; filename=\"test.png\"") + ) + .withBody(binary(pngBytes)) + ); + } + + public void responseLiteralWith10SecondDelay() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .respond( + response() + .withBody("some_response_body") + .withDelay(TimeUnit.SECONDS, 10) + ); + } + + public void javascriptTemplatedResponse() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .respond( + template( + HttpTemplate.TemplateType.JAVASCRIPT, + "return {" + System.getProperty("line.separator") + + " 'statusCode': 200," + System.getProperty("line.separator") + + " 'cookies': {" + System.getProperty("line.separator") + + " 'session' : request.headers['session-id'][0]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'headers': {" + System.getProperty("line.separator") + + " 'Date' : Date()" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " 'body': JSON.stringify(" + System.getProperty("line.separator") + + " {" + System.getProperty("line.separator") + + " method: request.method," + System.getProperty("line.separator") + + " path: request.path," + System.getProperty("line.separator") + + " body: request.body" + System.getProperty("line.separator") + + " }" + System.getProperty("line.separator") + + " )" + System.getProperty("line.separator") + + "};" + ) + ); + } + + public void javascriptTemplatedResponseWithDelay() { + String template = "" + + "if (request.method === 'POST' && request.path === '/somePath') {" + System.getProperty("line.separator") + + " return {" + System.getProperty("line.separator") + + " 'statusCode': 200," + System.getProperty("line.separator") + + " 'body': JSON.stringify({name: 'value'})" + System.getProperty("line.separator") + + " };" + System.getProperty("line.separator") + + "} else {" + System.getProperty("line.separator") + + " return {" + System.getProperty("line.separator") + + " 'statusCode': 406," + System.getProperty("line.separator") + + " 'body': request.body" + System.getProperty("line.separator") + + " };" + System.getProperty("line.separator") + + "}"; + + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .respond( + template(HttpTemplate.TemplateType.JAVASCRIPT) + .withTemplate(template) + .withDelay(TimeUnit.MINUTES, 2) + ); + + } + + public void velocityTemplatedResponse() { + new MockServerClient("localhost", 1080) + .when( + request() + .withPath("/some/path") + ) + .respond( + template( + HttpTemplate.TemplateType.VELOCITY, + "{" + System.getProperty("line.separator") + + " \"statusCode\": 200," + System.getProperty("line.separator") + + " \"cookies\": { " + System.getProperty("line.separator") + + " \"session\": \"$!request.headers['Session-Id'][0]\"" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " \"headers\": {" + System.getProperty("line.separator") + + " \"Client-User-Agent\": [ \"$!request.headers['User-Agent'][0]\" ]" + System.getProperty("line.separator") + + " }," + System.getProperty("line.separator") + + " \"body\": $!request.body" + System.getProperty("line.separator") + + "}" + ) + ); + } +} diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/configuration/RootConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/configuration/RootConfiguration.java similarity index 60% rename from mockserver-examples/src/main/java/org/mockserver/examples/configuration/RootConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/configuration/RootConfiguration.java index a9c872395..61f0831aa 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/configuration/RootConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/configuration/RootConfiguration.java @@ -1,12 +1,12 @@ -package org.mockserver.examples.configuration; +package org.mockserver.examples.proxy.configuration; -import org.mockserver.examples.service.apacheclient.ApacheHttpClientConfiguration; -import org.mockserver.examples.service.googleclient.GoogleHttpClientConfiguration; -import org.mockserver.examples.service.javaclient.JavaHttpClientConfiguration; -import org.mockserver.examples.service.jerseyclient.JerseyClientConfiguration; -import org.mockserver.examples.service.jettyclient.JettyHttpClientConfiguration; -import org.mockserver.examples.service.springclient.SpringRestTemplateConfiguration; -import org.mockserver.examples.servicebackend.BackEndServiceConfiguration; +import org.mockserver.examples.proxy.service.apacheclient.ApacheHttpClientConfiguration; +import org.mockserver.examples.proxy.service.googleclient.GoogleHttpClientConfiguration; +import org.mockserver.examples.proxy.service.javaclient.JavaHttpClientConfiguration; +import org.mockserver.examples.proxy.service.jerseyclient.JerseyClientConfiguration; +import org.mockserver.examples.proxy.service.jettyclient.JettyHttpClientConfiguration; +import org.mockserver.examples.proxy.service.springclient.SpringRestTemplateConfiguration; +import org.mockserver.examples.proxy.servicebackend.BackEndServiceConfiguration; import org.mockserver.socket.PortFactory; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/json/ObjectMapperFactory.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/json/ObjectMapperFactory.java similarity index 97% rename from mockserver-examples/src/main/java/org/mockserver/examples/json/ObjectMapperFactory.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/json/ObjectMapperFactory.java index 1669bc984..7b4f45485 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/json/ObjectMapperFactory.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/json/ObjectMapperFactory.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.json; +package org.mockserver.examples.proxy.json; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonParser; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/model/Book.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/model/Book.java similarity index 94% rename from mockserver-examples/src/main/java/org/mockserver/examples/model/Book.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/model/Book.java index c329023f4..0b685e226 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/model/Book.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/model/Book.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.model; +package org.mockserver.examples.proxy.model; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/BookService.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/BookService.java similarity index 55% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/BookService.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/BookService.java index 6b7166e9d..825cb8dab 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/BookService.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/BookService.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service; +package org.mockserver.examples.proxy.service; -import org.mockserver.examples.model.Book; +import org.mockserver.examples.proxy.model.Book; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/ApacheHttpClientConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/ApacheHttpClientConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/ApacheHttpClientConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/ApacheHttpClientConfiguration.java index c44964788..a876f7e83 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/ApacheHttpClientConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/ApacheHttpClientConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.apacheclient; +package org.mockserver.examples.proxy.service.apacheclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/BookServiceApacheHttpClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/BookServiceApacheHttpClient.java similarity index 92% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/BookServiceApacheHttpClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/BookServiceApacheHttpClient.java index 1bd4e714c..cfb35a407 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/apacheclient/BookServiceApacheHttpClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/apacheclient/BookServiceApacheHttpClient.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.service.apacheclient; +package org.mockserver.examples.proxy.service.apacheclient; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Charsets; @@ -10,15 +10,15 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.DefaultProxyRoutePlanner; import org.apache.http.util.EntityUtils; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import javax.annotation.Resource; -import static org.mockserver.examples.json.ObjectMapperFactory.createObjectMapper; +import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/BookServiceGoogleHttpClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/BookServiceGoogleHttpClient.java similarity index 92% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/BookServiceGoogleHttpClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/BookServiceGoogleHttpClient.java index 462e6db49..378bf99e6 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/BookServiceGoogleHttpClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/BookServiceGoogleHttpClient.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.service.googleclient; +package org.mockserver.examples.proxy.service.googleclient; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.api.client.http.*; import com.google.api.client.http.javanet.NetHttpTransport; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -17,7 +17,7 @@ import java.util.Collections; import java.util.List; -import static org.mockserver.examples.json.ObjectMapperFactory.createObjectMapper; +import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/GoogleHttpClientConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/GoogleHttpClientConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/GoogleHttpClientConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/GoogleHttpClientConfiguration.java index 3c9f8c601..506521e94 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/googleclient/GoogleHttpClientConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/googleclient/GoogleHttpClientConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.googleclient; +package org.mockserver.examples.proxy.service.googleclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/BookServiceJavaHttpClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/BookServiceJavaHttpClient.java similarity index 89% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/BookServiceJavaHttpClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/BookServiceJavaHttpClient.java index 1c208c740..74bcfdf2d 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/BookServiceJavaHttpClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/BookServiceJavaHttpClient.java @@ -1,8 +1,8 @@ -package org.mockserver.examples.service.javaclient; +package org.mockserver.examples.proxy.service.javaclient; import com.fasterxml.jackson.databind.ObjectMapper; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -14,7 +14,7 @@ import java.net.Proxy; import java.net.URL; -import static org.mockserver.examples.json.ObjectMapperFactory.createObjectMapper; +import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/JavaHttpClientConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/JavaHttpClientConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/JavaHttpClientConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/JavaHttpClientConfiguration.java index 941046090..41ebdb250 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/javaclient/JavaHttpClientConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/javaclient/JavaHttpClientConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.javaclient; +package org.mockserver.examples.proxy.service.javaclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/BookServiceJerseyClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/BookServiceJerseyClient.java similarity index 93% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/BookServiceJerseyClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/BookServiceJerseyClient.java index 503fc1c3d..4d4e9a3f0 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/BookServiceJerseyClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/BookServiceJerseyClient.java @@ -1,11 +1,11 @@ -package org.mockserver.examples.service.jerseyclient; +package org.mockserver.examples.proxy.service.jerseyclient; import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.jackson.JacksonFeature; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/JerseyClientConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/JerseyClientConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/JerseyClientConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/JerseyClientConfiguration.java index 95aecdef3..d3b987875 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/jerseyclient/JerseyClientConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jerseyclient/JerseyClientConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.jerseyclient; +package org.mockserver.examples.proxy.service.jerseyclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/BookServiceJettyHttpClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/BookServiceJettyHttpClient.java similarity index 92% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/BookServiceJettyHttpClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/BookServiceJettyHttpClient.java index 90402b995..1145c4dd9 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/BookServiceJettyHttpClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/BookServiceJettyHttpClient.java @@ -1,12 +1,12 @@ -package org.mockserver.examples.service.jettyclient; +package org.mockserver.examples.proxy.service.jettyclient; import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.jetty.client.Address; import org.eclipse.jetty.client.ContentExchange; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpExchange; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -14,7 +14,7 @@ import javax.annotation.PreDestroy; import javax.annotation.Resource; -import static org.mockserver.examples.json.ObjectMapperFactory.createObjectMapper; +import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/JettyHttpClientConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/JettyHttpClientConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/JettyHttpClientConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/JettyHttpClientConfiguration.java index 9a2a32485..0f2a2930d 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/jettyclient/JettyHttpClientConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/jettyclient/JettyHttpClientConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.jettyclient; +package org.mockserver.examples.proxy.service.jettyclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/BookServiceSpringRestTemplateClient.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/BookServiceSpringRestTemplateClient.java similarity index 91% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/BookServiceSpringRestTemplateClient.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/BookServiceSpringRestTemplateClient.java index 2c3e23a5e..009d019de 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/BookServiceSpringRestTemplateClient.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/BookServiceSpringRestTemplateClient.java @@ -1,12 +1,12 @@ -package org.mockserver.examples.service.springclient; +package org.mockserver.examples.proxy.service.springclient; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.DefaultProxyRoutePlanner; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.converter.HttpMessageConverter; @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.List; -import static org.mockserver.examples.json.ObjectMapperFactory.createObjectMapper; +import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/SpringRestTemplateConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/SpringRestTemplateConfiguration.java similarity index 84% rename from mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/SpringRestTemplateConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/SpringRestTemplateConfiguration.java index 96629ad99..db71cfb7a 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/service/springclient/SpringRestTemplateConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/SpringRestTemplateConfiguration.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.service.springclient; +package org.mockserver.examples.proxy.service.springclient; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BackEndServiceConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BackEndServiceConfiguration.java similarity index 93% rename from mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BackEndServiceConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BackEndServiceConfiguration.java index 4b7f0162f..4ca43ec9d 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BackEndServiceConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BackEndServiceConfiguration.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.servicebackend; +package org.mockserver.examples.proxy.servicebackend; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BookServer.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BookServer.java similarity index 97% rename from mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BookServer.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BookServer.java index 6d5abb255..eeee26cc2 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/BookServer.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/BookServer.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.servicebackend; +package org.mockserver.examples.proxy.servicebackend; import com.fasterxml.jackson.databind.ObjectMapper; import io.netty.bootstrap.ServerBootstrap; @@ -8,8 +8,8 @@ import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.http.*; -import org.mockserver.examples.json.ObjectMapperFactory; -import org.mockserver.examples.model.Book; +import org.mockserver.examples.proxy.json.ObjectMapperFactory; +import org.mockserver.examples.proxy.model.Book; import org.mockserver.socket.NettySslContextFactory; import javax.annotation.PostConstruct; diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/books.js b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/books.js similarity index 100% rename from mockserver-examples/src/main/java/org/mockserver/examples/servicebackend/books.js rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/servicebackend/books.js diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/web/configuration/WebMvcConfiguration.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/configuration/WebMvcConfiguration.java similarity index 95% rename from mockserver-examples/src/main/java/org/mockserver/examples/web/configuration/WebMvcConfiguration.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/configuration/WebMvcConfiguration.java index ae5ff9678..3f5674ad8 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/web/configuration/WebMvcConfiguration.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/configuration/WebMvcConfiguration.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.web.configuration; +package org.mockserver.examples.proxy.web.configuration; import com.google.common.net.MediaType; import freemarker.cache.ClassTemplateLoader; @@ -24,7 +24,7 @@ */ @Configuration @EnableWebMvc -@ComponentScan(basePackages = {"org.mockserver.examples.web"}) +@ComponentScan(basePackages = {"org.mockserver.examples.proxy.web"}) public class WebMvcConfiguration extends WebMvcConfigurerAdapter { @Override diff --git a/mockserver-examples/src/main/java/org/mockserver/examples/web/controller/BooksPageController.java b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/controller/BooksPageController.java similarity index 88% rename from mockserver-examples/src/main/java/org/mockserver/examples/web/controller/BooksPageController.java rename to mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/controller/BooksPageController.java index 2409f268f..f47b504bc 100644 --- a/mockserver-examples/src/main/java/org/mockserver/examples/web/controller/BooksPageController.java +++ b/mockserver-examples/src/main/java/org/mockserver/examples/proxy/web/controller/BooksPageController.java @@ -1,6 +1,6 @@ -package org.mockserver.examples.web.controller; +package org.mockserver.examples.proxy.web.controller; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; diff --git a/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/test.png b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/test.png new file mode 100644 index 000000000..ccc5a5402 Binary files /dev/null and b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/test.png differ diff --git a/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testJsonSchema.json b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testJsonSchema.json new file mode 100644 index 000000000..09632b028 --- /dev/null +++ b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testJsonSchema.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "someField": { + "type": "string" + } + }, + "required": ["someField"] +} \ No newline at end of file diff --git a/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testXmlSchema.xsd b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testXmlSchema.xsd new file mode 100644 index 000000000..01ea49bab --- /dev/null +++ b/mockserver-examples/src/main/resources/org/mockserver/examples/mockserver/testXmlSchema.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mockserver-examples/src/main/webapp/WEB-INF/web.xml b/mockserver-examples/src/main/webapp/WEB-INF/web.xml index 167a7af11..5031c0b3c 100644 --- a/mockserver-examples/src/main/webapp/WEB-INF/web.xml +++ b/mockserver-examples/src/main/webapp/WEB-INF/web.xml @@ -17,7 +17,7 @@ contextConfigLocation - org.mockserver.examples.configuration.RootConfiguration + org.mockserver.examples.proxy.configuration.RootConfiguration @@ -40,7 +40,7 @@ contextConfigLocation - org.mockserver.examples.web.configuration.WebMvcConfiguration + org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration 1 @@ -54,4 +54,4 @@ - \ No newline at end of file + diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageControllerTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageControllerTest.java similarity index 90% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageControllerTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageControllerTest.java index b8c937c59..0372a93c7 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageControllerTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageControllerTest.java @@ -1,11 +1,11 @@ -package org.mockserver.examples.web.controller; +package org.mockserver.examples.proxy.web.controller; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockserver.examples.model.Book; -import org.mockserver.examples.service.BookService; +import org.mockserver.examples.proxy.model.Book; +import org.mockserver.examples.proxy.service.BookService; import org.springframework.ui.Model; import static org.junit.Assert.assertEquals; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageEndToEndIntegrationTest.java similarity index 91% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageEndToEndIntegrationTest.java index 8cd5fdc68..316790ff7 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageEndToEndIntegrationTest.java @@ -1,12 +1,12 @@ -package org.mockserver.examples.web.controller; +package org.mockserver.examples.proxy.web.controller; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.mockserver.examples.servicebackend.BookServer; -import org.mockserver.examples.web.controller.pageobjects.BookPage; -import org.mockserver.examples.web.controller.pageobjects.BooksPage; +import org.mockserver.examples.proxy.servicebackend.BookServer; +import org.mockserver.examples.proxy.web.controller.pageobjects.BookPage; +import org.mockserver.examples.proxy.web.controller.pageobjects.BooksPage; import org.mockserver.integration.ClientAndProxy; import org.mockserver.model.Parameter; import org.mockserver.socket.PortFactory; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageIntegrationTest.java similarity index 96% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageIntegrationTest.java index 438ae084f..661d604d5 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/BooksPageIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/BooksPageIntegrationTest.java @@ -1,15 +1,15 @@ -package org.mockserver.examples.web.controller; +package org.mockserver.examples.proxy.web.controller; import io.netty.handler.codec.http.HttpHeaders; import org.junit.*; import org.mockserver.integration.ClientAndProxy; import org.mockserver.integration.ClientAndServer; -import org.mockserver.examples.model.Book; +import org.mockserver.examples.proxy.model.Book; import org.mockserver.model.Header; import org.mockserver.model.Parameter; import org.mockserver.socket.PortFactory; -import org.mockserver.examples.web.controller.pageobjects.BookPage; -import org.mockserver.examples.web.controller.pageobjects.BooksPage; +import org.mockserver.examples.proxy.web.controller.pageobjects.BookPage; +import org.mockserver.examples.proxy.web.controller.pageobjects.BooksPage; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/PropertyMockingApplicationContextInitializer.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/PropertyMockingApplicationContextInitializer.java similarity index 94% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/PropertyMockingApplicationContextInitializer.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/PropertyMockingApplicationContextInitializer.java index b9437dc11..b2741a3b1 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/PropertyMockingApplicationContextInitializer.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/PropertyMockingApplicationContextInitializer.java @@ -1,4 +1,4 @@ -package org.mockserver.examples.web.controller; +package org.mockserver.examples.proxy.web.controller; import org.mockserver.socket.PortFactory; import org.springframework.context.ApplicationContextInitializer; @@ -15,4 +15,4 @@ public void initialize(ConfigurableApplicationContext applicationContext) { MockPropertySource mockEnvVars = new MockPropertySource().withProperty("bookService.port", PortFactory.findFreePort()); propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars); } -} \ No newline at end of file +} diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java index a24f72d4c..69c13a30b 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.apacheclient; +package org.mockserver.examples.proxy.web.controller.apacheclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java index fb1ce9bd2..fadc4a4fd 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/apacheclient/BooksPageApacheClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.apacheclient; +package org.mockserver.examples.proxy.web.controller.apacheclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java index 1d54544cb..fbfea5267 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.googleclient; +package org.mockserver.examples.proxy.web.controller.googleclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java index f2b75019c..d2b02ec5c 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/googleclient/BooksPageGoogleClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.googleclient; +package org.mockserver.examples.proxy.web.controller.googleclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java index 4e3d45fed..306a56912 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.javaclient; +package org.mockserver.examples.proxy.web.controller.javaclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java index ca340b2f1..e1eca4d58 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/javaclient/BooksPageJavaClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.javaclient; +package org.mockserver.examples.proxy.web.controller.javaclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java index fe38c80e3..bd963c7cb 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.jerseyclient; +package org.mockserver.examples.proxy.web.controller.jerseyclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java index 8d7103fb7..fbe51b66c 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jerseyclient/BooksPageJerseyClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.jerseyclient; +package org.mockserver.examples.proxy.web.controller.jerseyclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java index 46bc269a4..fec5c13af 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.jettyclient; +package org.mockserver.examples.proxy.web.controller.jettyclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java index c98faa7e2..acd86f48e 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/jettyclient/BooksPageJettyClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.jettyclient; +package org.mockserver.examples.proxy.web.controller.jettyclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BookPage.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BookPage.java similarity index 88% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BookPage.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BookPage.java index f52226570..6922f856d 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BookPage.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BookPage.java @@ -1,8 +1,8 @@ -package org.mockserver.examples.web.controller.pageobjects; +package org.mockserver.examples.proxy.web.controller.pageobjects; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import org.mockserver.examples.model.Book; +import org.mockserver.examples.proxy.model.Book; import org.springframework.test.web.servlet.MvcResult; import java.io.UnsupportedEncodingException; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BooksPage.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BooksPage.java similarity index 88% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BooksPage.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BooksPage.java index 7be266e1e..fbaaee54c 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/pageobjects/BooksPage.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/pageobjects/BooksPage.java @@ -1,9 +1,9 @@ -package org.mockserver.examples.web.controller.pageobjects; +package org.mockserver.examples.proxy.web.controller.pageobjects; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; -import org.mockserver.examples.model.Book; +import org.mockserver.examples.proxy.model.Book; import org.springframework.test.web.servlet.MvcResult; import java.io.UnsupportedEncodingException; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java index 48d2251e6..4de7000a4 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientEndToEndIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.springclient; +package org.mockserver.examples.proxy.web.controller.springclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageEndToEndIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageEndToEndIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientIntegrationTest.java b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientIntegrationTest.java similarity index 71% rename from mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientIntegrationTest.java rename to mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientIntegrationTest.java index 3a98e3257..9581422a9 100644 --- a/mockserver-examples/src/test/java/org/mockserver/examples/web/controller/springclient/BooksPageSpringClientIntegrationTest.java +++ b/mockserver-examples/src/test/java/org/mockserver/examples/proxy/web/controller/springclient/BooksPageSpringClientIntegrationTest.java @@ -1,10 +1,10 @@ -package org.mockserver.examples.web.controller.springclient; +package org.mockserver.examples.proxy.web.controller.springclient; import org.junit.runner.RunWith; -import org.mockserver.examples.configuration.RootConfiguration; -import org.mockserver.examples.web.configuration.WebMvcConfiguration; -import org.mockserver.examples.web.controller.BooksPageIntegrationTest; -import org.mockserver.examples.web.controller.PropertyMockingApplicationContextInitializer; +import org.mockserver.examples.proxy.configuration.RootConfiguration; +import org.mockserver.examples.proxy.web.configuration.WebMvcConfiguration; +import org.mockserver.examples.proxy.web.controller.BooksPageIntegrationTest; +import org.mockserver.examples.proxy.web.controller.PropertyMockingApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextHierarchy; diff --git a/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/SameJVMAbstractClientServerIntegrationTest.java b/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/SameJVMAbstractClientServerIntegrationTest.java index 7989b5368..b5ae38823 100644 --- a/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/SameJVMAbstractClientServerIntegrationTest.java +++ b/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/SameJVMAbstractClientServerIntegrationTest.java @@ -26,7 +26,7 @@ public abstract class SameJVMAbstractClientServerIntegrationTest extends AbstractClientServerIntegrationTest { @Test - public void shouldCallbackToSpecifiedClassWithResponseOnStaticField() { + public void shouldCallbackToObject() { // given StaticTestExpectationCallback.httpRequests.clear(); StaticTestExpectationCallback.httpResponse = response()