1"use strict";(self.webpackChunkpartners=self.webpackChunkpartners||[]).push([[16001],{15680:(e,t,a)=>{a.d(t,{xA:()=>l,yg:()=>f});var r=a(96540);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function p(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?n(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function s(e,t){if(null==e)return{};var a,r,o=function(e,t){if(null==e)return{};var a,r,o={},n=Object.keys(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||(o[a]=e[a]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var i=r.createContext({}),c=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):p(p({},t),e)),a},l=function(e){var t=c(e.components);return r.createElement(i.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var a=e.components,o=e.mdxType,n=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=c(a),d=o,f=u["".concat(i,".").concat(d)]||u[d]||m[d]||n;return a?r.createElement(f,p(p({ref:t},l),{},{components:a})):r.createElement(f,p({ref:t},l))}));function f(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var n=a.length,p=new Array(n);p[0]=d;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[u]="string"==typeof e?e:o,p[1]=s;for(var c=2;c<n;c++)p[c]=a[c];return r.createElement.apply(null,p)}return r.createElement.apply(null,a)}d.displayName="MDXCreateElement"},81389:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>p,default:()=>m,frontMatter:()=>n,metadata:()=>s,toc:()=>c});var r=a(58168),o=(a(96540),a(15680));const n={custom_edit_url:"https://github.com/pactflow/example-consumer-java-junit/edit/master/README.md",title:"Example Java Junit Consumer",sidebar_label:"Example Java Junit Consumer"},p=void 0,s={unversionedId:"docs/examples/java/consumer/junit/readme",id:"docs/examples/java/consumer/junit/readme",title:"Example Java Junit Consumer",description:"Source Code",source:"@site/docs/docs/examples/java/consumer/junit/readme.md",sourceDirName:"docs/examples/java/consumer/junit",slug:"/docs/examples/java/consumer/junit/",permalink:"/docs/examples/java/consumer/junit/",draft:!1,editUrl:"https://github.com/pactflow/example-consumer-java-junit/edit/master/README.md",tags:[],version:"current",lastUpdatedBy:"Yousaf Nabi",lastUpdatedAt:1674493712,formattedLastUpdatedAt:"Jan 23, 2023",frontMatter:{custom_edit_url:"https://github.com/pactflow/example-consumer-java-junit/edit/master/README.md",title:"Example Java Junit Consumer",sidebar_label:"Example Java Junit Consumer"},sidebar:"examples",previous:{title:"Example Java GraphQL Consumer",permalink:"/docs/examples/java/consumer/graphql/"},next:{title:"Example Java GraphQL Provider",permalink:"/docs/examples/java/provider/graphql/"}},i={},c=[{value:"Source Code",id:"source-code",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Usage",id:"usage",level:2}],l={toc:c},u="wrapper";
1function m(e){let{components:t,...a}=e;return(0,o.yg)(u,(0,r.A)({},l,a,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h2",{id:"source-code"},"Source Code"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://github.com/pactflow/example-consumer-java-junit"},"https://github.com/pactflow/example-consumer-java-junit")),(0,o.yg)("p",null,(0,o.yg)("img",{parentName:"p",src:"https://github.com/pactflow/example-consumer-java-junit/workflows/Build/badge.svg",alt:"Build"})),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://test.pactflow.io/overview/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit"},(0,o.yg)("img",{parentName:"a",src:"https://test.pactflow.io/pacticipants/pactflow-example-consumer-java-junit/branches/master/latest-version/can-i-deploy/to-environment/production/badge.svg",alt:"Can I deploy Status"}))),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest"},(0,o.yg)("img",{parentName:"a",src:"https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/badge.svg",alt:"Pact Status"}))," (latest pact)"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/prod"},(0,o.yg)("img",{parentName:"a",src:"https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/prod/badge.svg",alt:"Pact Status"}))," (prod/prod pact)"),(0,o.yg)("p",null,"This is an example of a Java consumer that uses Pact with Junit, ",(0,o.yg)("a",{parentName:"p",href:"https://pactflow.io"},"PactFlow")," and GitHub Actions to ensure that it is compatible with the expectations its consumers have of it."),(0,o.yg)("p",null,"The project uses a Makefile to simulate a very simple build pipeline with two stages - test and deploy."),(0,o.yg)("p",null,"It is using a public tenant on PactFlow, which you can access ",(0,o.yg)("a",{parentName:"p",href:"https://test.pactflow.io"},"here")," using the credentials ",(0,o.yg)("inlineCode",{parentName:"p"},"dXfltyFMgNOFZAxr8io9wJ37iUpY42M"),"/",(0,o.yg)("inlineCode",{parentName:"p"},"O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1"),"."),(0,o.yg)("p",null,"See the canonical consumer example here: ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/pactflow/example-consumer"},"https://github.com/pactflow/example-consumer"),"\nSee also the full ",(0,o.yg)("a",{parentName:"p",href:"https://docs.pactflow.io/docs/workshops/ci-cd"},"PactFlow CI/CD Workshop"),' for which this can be substituted in as the "consumer".'),(0,o.yg)("h2",{id:"pre-requisites"},"Pre-requisites"),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Software"),":"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/prerequisites/"},"https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/prerequisites/")),(0,o.yg)("h2",{id:"usage"},"Usage"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-sh"},"make test\n")))}m.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.