Giter Site home page Giter Site logo

dropwizardappandpactdemo's Introduction

DropWizard Framework And PACT Demo

Overview

We have developed an Microservice Application Using Dropwizard Framework . Then we have included the Unit Tests related to the Application. It also have Consumer driven test by using Pact.

Contents

Micoservice Details

Microservice Service 1: Currency Exchange Service

If you ask it the value of 1 USD in INR, or 1 Australian Dollar in INR, the Currency Exchange Service answers

  • 1 USD is 60 INR
  • 1 Australian Dollars is 50 INR.

http://localhost:8080/currency-exchange/from/EUR/to/INR

{
  "id": 10002,
  "from": "EUR",
  "to": "INR",
  "conversionMultiple": 75.00,
  "exchangeEnvironmentInfo": "37f1ad927c6e v1 27c6e"
}

Execution

Step 1: The Application Deployment

  • Build Application Jar File :
    mvn clean package
    This will first perform mvn clean test on the currency-conversion-dropwizard-demoapplication which will run all unit test
    And then create a DropWizardDemo-1.0-SNAPSHOT.jar inside the target folder

  • Start application in jetty server(Default DropWizard Server) :
    java -jar target/DropWizardDemo-1.0-SNAPSHOT.jar server example.yml

Now, the application is up and running and it will be accessable in the port.
http://localhost:8080/currency-exchange/from/EUR/to/INR

Step 2: Start a Pact Broker

The Broker will be up and running http://localhost:8113/

Step 3: Run the Consumer Side Test

  • Run the Consumer Side Test and Generate the Pact Files
    We will navigate to the consumer-side-test Project.
    Then run the command, mvn clean test
    It will run all the Consumer side test, and also generate the pact files

  • Push the Generate Pact Files into the Pact Broker
    mvn pact:publish
    You will be able to see the Contract Details from the Broker UI.

Step 4: Verify the Contract from the Producer Side

  • Run the Producer Test We will navigate to the producer-side-test Project.
    Then run the command, mvn pact:verify
    It will verify the Customer Contract in the Producer End by taking the contract from the Broker

You will be able to see the Verification Details from the Broker UI.

Step 4: Break the API on the Provider Side and run the test again

dropwizardappandpactdemo's People

Contributors

kingshuknandy2016 avatar kingshuk-nandy avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.