This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener). # Fixed URLs ## Fixed Success These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended. * [ ] http://www.apache.org/licenses/ with 50 occurrences migrated to: https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200). * [ ] http://www.apache.org/licenses/LICENSE-2.0 with 347 occurrences migrated to: https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
465 lines
25 KiB
HTML
465 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-06-19
|
|
| Rendered using Apache Maven Fluido Skin 1.5
|
|
-->
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="Date-Revision-yyyymmdd" content="20180619" />
|
|
<meta http-equiv="Content-Language" content="en" />
|
|
<title>Spring Cloud Contract Maven Plugin – </title>
|
|
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
|
<link rel="stylesheet" href="./css/site.css" />
|
|
<link rel="stylesheet" href="./css/print.css" media="print" />
|
|
|
|
|
|
<script type="text/javascript" src="./js/apache-maven-fluido-1.5.min.js"></script>
|
|
|
|
</head>
|
|
<body class="topBarEnabled">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/spring-cloud/spring-cloud-contract">
|
|
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
|
|
src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"
|
|
alt="Fork me on GitHub">
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="topbar" class="navbar navbar-fixed-top ">
|
|
<div class="navbar-inner">
|
|
<div class="container-fluid">
|
|
<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</a>
|
|
|
|
<ul class="nav">
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
|
|
<ul class="dropdown-menu">
|
|
|
|
<li> <a href="index.html" title="Introduction">Introduction</a>
|
|
</li>
|
|
|
|
<li> <a href="usage.html" title="Usage">Usage</a>
|
|
</li>
|
|
|
|
<li> <a href="plugin-info.html" title="Goals">Goals</a>
|
|
</li>
|
|
|
|
<li> <a href="junit.html" title="JUnit Configuration">JUnit Configuration</a>
|
|
</li>
|
|
|
|
<li> <a href="spock.html" title="Spock Configuration">Spock Configuration</a>
|
|
</li>
|
|
|
|
<li> <a href="complex.html" title="Complex Configuration">Complex Configuration</a>
|
|
</li>
|
|
|
|
<li> <a href="configs.html" title="Configuration snippets">Configuration snippets</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Related Projects <b class="caret"></b></a>
|
|
<ul class="dropdown-menu">
|
|
|
|
<li> <a href="https://github.com/spring-cloud/spring-cloud-contract" title="Spring Cloud Contract">Spring Cloud Contract</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Documentation <b class="caret"></b></a>
|
|
<ul class="dropdown-menu">
|
|
|
|
<li class="dropdown-submenu">
|
|
<a href="project-info.html" title="Project Information">Project Information</a>
|
|
<ul class="dropdown-menu">
|
|
<li> <a href="integration.html" title="CI Management">CI Management</a>
|
|
</li>
|
|
<li> <a href="index.html" title="About">About</a>
|
|
</li>
|
|
<li> <a href="issue-tracking.html" title="Issue Management">Issue Management</a>
|
|
</li>
|
|
<li> <a href="license.html" title="Licenses">Licenses</a>
|
|
</li>
|
|
<li> <a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
|
|
</li>
|
|
<li> <a href="plugins.html" title="Plugins">Plugins</a>
|
|
</li>
|
|
<li> <a href="team-list.html" title="Team">Team</a>
|
|
</li>
|
|
<li> <a href="source-repository.html" title="Source Code Management">Source Code Management</a>
|
|
</li>
|
|
<li> <a href="project-summary.html" title="Summary">Summary</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="dropdown-submenu">
|
|
<a href="project-reports.html" title="Project Reports">Project Reports</a>
|
|
<ul class="dropdown-menu">
|
|
<li> <a href="checkstyle.html" title="Checkstyle">Checkstyle</a>
|
|
</li>
|
|
<li> <a href="plugin-info.html" title="Plugin Documentation">Plugin Documentation</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container-fluid">
|
|
<div id="banner">
|
|
<div class="pull-left">
|
|
<div id="bannerLeft">
|
|
<h2>Spring Cloud Contract Maven Plugin</h2>
|
|
</div>
|
|
</div>
|
|
<div class="pull-right"> <div id="bannerRight">
|
|
<img src="" />
|
|
</div>
|
|
</div>
|
|
<div class="clear"><hr/></div>
|
|
</div>
|
|
|
|
<div id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
|
|
<li id="publishDate">Last Published: 2018-06-19
|
|
<span class="divider">|</span>
|
|
</li>
|
|
<li id="projectVersion">Version: 2.0.0.RELEASE
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<div class="row-fluid">
|
|
<div id="leftColumn" class="span2">
|
|
<div class="well sidebar-nav">
|
|
|
|
<ul class="nav nav-list">
|
|
<li class="nav-header">Overview</li>
|
|
|
|
<li>
|
|
|
|
<a href="index.html" title="Introduction">
|
|
<span class="none"></span>
|
|
Introduction</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="usage.html" title="Usage">
|
|
<span class="none"></span>
|
|
Usage</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="plugin-info.html" title="Goals">
|
|
<span class="none"></span>
|
|
Goals</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="junit.html" title="JUnit Configuration">
|
|
<span class="none"></span>
|
|
JUnit Configuration</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="spock.html" title="Spock Configuration">
|
|
<span class="none"></span>
|
|
Spock Configuration</a>
|
|
</li>
|
|
|
|
<li class="active">
|
|
|
|
<a href="#"><span class="none"></span>Complex Configuration</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="configs.html" title="Configuration snippets">
|
|
<span class="none"></span>
|
|
Configuration snippets</a>
|
|
</li>
|
|
<li class="nav-header">Related Projects</li>
|
|
|
|
<li>
|
|
|
|
<a href="https://github.com/spring-cloud/spring-cloud-contract" title="Spring Cloud Contract">
|
|
<span class="none"></span>
|
|
Spring Cloud Contract</a>
|
|
</li>
|
|
<li class="nav-header">Project Documentation</li>
|
|
|
|
<li>
|
|
|
|
<a href="project-info.html" title="Project Information">
|
|
<span class="icon-chevron-right"></span>
|
|
Project Information</a>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="project-reports.html" title="Project Reports">
|
|
<span class="icon-chevron-right"></span>
|
|
Project Reports</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
<hr />
|
|
|
|
<div id="poweredBy">
|
|
<div class="clear"></div>
|
|
<div class="clear"></div>
|
|
<div class="clear"></div>
|
|
<div class="clear"></div>
|
|
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
|
|
<img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="bodyColumn" class="span10" >
|
|
|
|
<div class="sect1">
|
|
<h2 id="more_complex_plugin_configuration">More Complex Plugin Configuration</h2>
|
|
<div class="sectionbody">
|
|
<div class="paragraph">
|
|
<p>Sample more complex configuration for Java Project with JUnit tests.</p>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="project_configuration_for_spring_cloud_contract_verifier_with_junit_tests_and_stub_publishing">Project configuration for Spring Cloud Contract Verifier with JUnit tests and stub publishing</h3>
|
|
<div class="listingblock">
|
|
<div class="content">
|
|
<pre class="CodeRay highlight"><code data-lang="xml"> <span style="color:#070;font-weight:bold"><plugin></span>
|
|
<span style="color:#070;font-weight:bold"><groupId></span>org.springframework.cloud<span style="color:#070;font-weight:bold"></groupId></span>
|
|
<span style="color:#070;font-weight:bold"><artifactId></span>spring-cloud-contract-maven-plugin<span style="color:#070;font-weight:bold"></artifactId></span>
|
|
<span style="color:#070;font-weight:bold"><version></span>${spring-cloud-verifier-plugin.version}<span style="color:#070;font-weight:bold"></version></span>
|
|
<span style="color:#070;font-weight:bold"><executions></span>
|
|
<span style="color:#070;font-weight:bold"><execution></span>
|
|
<span style="color:#070;font-weight:bold"><goals></span>
|
|
<span style="color:#070;font-weight:bold"><goal></span>convert<span style="color:#070;font-weight:bold"></goal></span>
|
|
<span style="color:#070;font-weight:bold"><goal></span>generateStubs<span style="color:#070;font-weight:bold"></goal></span>
|
|
<span style="color:#070;font-weight:bold"><goal></span>generateTests<span style="color:#070;font-weight:bold"></goal></span>
|
|
<span style="color:#070;font-weight:bold"></goals></span>
|
|
<span style="color:#070;font-weight:bold"><configuration></span>
|
|
<span style="color:#070;font-weight:bold"><contractsDirectory></span>src/test/contracts<span style="color:#070;font-weight:bold"></contractsDirectory></span>
|
|
<span style="color:#070;font-weight:bold"><basePackageForTests></span>com.blogspot.toomuchcoding.frauddetection<span style="color:#070;font-weight:bold"></basePackageForTests></span>
|
|
<span style="color:#070;font-weight:bold"><testMode></span>MOCKMVC<span style="color:#070;font-weight:bold"></testMode></span>
|
|
<span style="color:#070;font-weight:bold"><testFramework></span>JUNIT<span style="color:#070;font-weight:bold"></testFramework></span>
|
|
<span style="color:#070;font-weight:bold"><classifier></span>stubs<span style="color:#070;font-weight:bold"></classifier></span>
|
|
<span style="color:#070;font-weight:bold"><nameSuffixForTests></span>Test<span style="color:#070;font-weight:bold"></nameSuffixForTests></span>
|
|
<span style="color:#070;font-weight:bold"><ruleClassForTests></span>org.junit.rules.ErrorCollector<span style="color:#070;font-weight:bold"></ruleClassForTests></span>
|
|
<span style="color:#070;font-weight:bold"><staticImports></span>
|
|
<span style="color:#070;font-weight:bold"><staticImport></span>com.blogspot.toomuchcoding.frauddetection.matchers.CustomMatchers.*<span style="color:#070;font-weight:bold"></staticImport></span>
|
|
<span style="color:#070;font-weight:bold"></staticImports></span>
|
|
<span style="color:#070;font-weight:bold"><imports></span>
|
|
<span style="color:#070;font-weight:bold"><import></span>com.blogspot.toomuchcoding.frauddetection.matchers.CustomMatchers<span style="color:#070;font-weight:bold"></import></span>
|
|
<span style="color:#070;font-weight:bold"></imports></span>
|
|
<span style="color:#070;font-weight:bold"><ignoredFiles></span>
|
|
<span style="color:#070;font-weight:bold"><ignoredFile></span>broken**<span style="color:#070;font-weight:bold"></ignoredFile></span>
|
|
<span style="color:#070;font-weight:bold"></ignoredFiles></span>
|
|
<span style="color:#070;font-weight:bold"><excludedFiles></span>
|
|
<span style="color:#070;font-weight:bold"><param></span>shouldMarkClientAsFraud.groovy<span style="color:#070;font-weight:bold"></param></span>
|
|
<span style="color:#070;font-weight:bold"></excludedFiles></span>
|
|
<span style="color:#070;font-weight:bold"></configuration></span>
|
|
<span style="color:#070;font-weight:bold"></execution></span>
|
|
<span style="color:#070;font-weight:bold"></executions></span>
|
|
<span style="color:#070;font-weight:bold"><configuration></span>
|
|
<span style="color:#070;font-weight:bold"><baseClassForTests></span>com.blogspot.toomuchcoding.frauddetection.BaseAccurest<span style="color:#070;font-weight:bold"></baseClassForTests></span>
|
|
<span style="color:#070;font-weight:bold"></configuration></span>
|
|
<span style="color:#070;font-weight:bold"></plugin></span></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="base_test_class">Base Test class</h3>
|
|
<div class="listingblock">
|
|
<div class="content">
|
|
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#777">/**
|
|
*
|
|
* Copyright 2013-2017 the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/</span>
|
|
<span style="color:#080;font-weight:bold">package</span> <span style="color:#707;font-weight:bold">com.blogspot.toomuchcoding.frauddetection</span>;
|
|
|
|
<span style="color:#080;font-weight:bold">import</span> <span style="color:#B44;font-weight:bold">io.restassured.module.mockmvc.RestAssuredMockMvc</span>;
|
|
|
|
<span style="color:#080;font-weight:bold">import</span> <span style="color:#B44;font-weight:bold">org.junit.Before</span>;
|
|
|
|
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">BaseAccurest</span> {
|
|
|
|
<span style="color:#007">@Before</span>
|
|
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">void</span> setup() {
|
|
RestAssuredMockMvc.standaloneSetup(<span style="color:#080;font-weight:bold">new</span> FraudDetectionController());
|
|
}
|
|
|
|
}</code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="sample_additional_matcher">Sample additional matcher</h3>
|
|
<div class="listingblock">
|
|
<div class="content">
|
|
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#777">/**
|
|
*
|
|
* Copyright 2013-2017 the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/</span>
|
|
<span style="color:#080;font-weight:bold">package</span> <span style="color:#707;font-weight:bold">com.blogspot.toomuchcoding.frauddetection.matchers</span>;
|
|
|
|
<span style="color:#080;font-weight:bold">import</span> <span style="color:#B44;font-weight:bold">org.junit.Assert</span>;
|
|
|
|
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">CustomMatchers</span> {
|
|
|
|
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#339;font-weight:bold">void</span> assertThatRejectionReasonIsNull(<span style="color:#0a8;font-weight:bold">String</span> rejectionReason) {
|
|
Assert.assertNull(rejectionReason);
|
|
}
|
|
|
|
}</code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="sample_contract_using_matcher">Sample contract using matcher</h3>
|
|
<div class="listingblock">
|
|
<div class="content">
|
|
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#777">/**
|
|
*
|
|
* Copyright 2013-2017 the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/</span>
|
|
org.springframework.cloud.contract.spec.Contract.make {
|
|
request {
|
|
method <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">PUT</span><span style="color:#710">'</span></span>
|
|
url <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">/fraudcheck</span><span style="color:#710">'</span></span>
|
|
body(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#710">"</span></span><span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">
|
|
{
|
|
</span><span style="color:#710">"</span></span>clientPesel<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">:</span><span style="color:#710">"</span></span><span style="color:#F00;background-color:#FAA">$</span>{value(consumer(regex(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">[0-9]{10}</span><span style="color:#710">'</span></span>)), producer(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">1234567890</span><span style="color:#710">'</span></span>))}<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">,
|
|
</span><span style="color:#710">"</span></span>loanAmount<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">:123.123
|
|
}
|
|
</span><span style="color:#710">"</span></span><span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#710">"</span></span>
|
|
)
|
|
headers {
|
|
header(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Content-Type</span><span style="color:#710">'</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">application/vnd.fraud.v1+json</span><span style="color:#710">'</span></span>)
|
|
}
|
|
|
|
}
|
|
response {
|
|
status OK()
|
|
body(
|
|
fraudCheckStatus: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">OK</span><span style="color:#710">"</span></span>,
|
|
rejectionReason: <span style="color:#F00;background-color:#FAA">$</span>(consumer(<span style="color:#069">null</span>), producer(execute(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">assertThatRejectionReasonIsNull($it)</span><span style="color:#710">'</span></span>)))
|
|
)
|
|
headers {
|
|
header(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Content-Type</span><span style="color:#710">'</span></span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">application/vnd.fraud.v1+json</span><span style="color:#710">'</span></span>)
|
|
}
|
|
}
|
|
|
|
}</code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="project_source_code">Project source code</h3>
|
|
<div class="paragraph">
|
|
<p><a href="https://github.com/Codearte/accurest-maven-plugin/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/complex-configuration" class="bare">https://github.com/Codearte/accurest-maven-plugin/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/complex-configuration</a></p>
|
|
</div>
|
|
</div>
|
|
<div class="sect2">
|
|
<h3 id="more_samples">More samples</h3>
|
|
<div class="paragraph">
|
|
<p>You can check out the <a href="https://github.com/spring-cloud-samples/spring-cloud-contract-samples">Spring Cloud Contract Samples project</a> for
|
|
more examples of Maven plugin setup.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<footer>
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<p >Copyright © 2016–2018
|
|
<a href="https://spring.io/">Spring</a>.
|
|
All rights reserved.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|