Code Monkey home page Code Monkey logo

gamification-engine's Introduction

Gamification engine

Test the running application with Postman & newman

We have defined a Postman collection (Badge.postman_collection.json) that you can import.
It will use envrionnement variables, like the api key or last badge id created. You can also run the collection with Newman to :

  • Register a demo application
  • Add a badge, a event type and a rule

First you need to install Newman :
npm install -g newman
Then run the .json collection file :
newman run Badge.postman_collection.json
It will create all the stuff mentionned above and run the test on the status code.

Build and run the Badge microservice

You can use maven to build and run the REST API implementation from the command line. After invoking the following maven goal, the Spring Boot server will be up and running, listening for connections on port 8080.

cd badges-impl/
mvn spring-boot:run

You can then access:

You can use curl to invoke the endpoints:

  • To retrieve the list of badges previously created:
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/badges'
  • To create a new badge (beware that in the live documentation, there are extra \ line separators in the JSON payload that cause issues in some shells)
curl -X POST --header 'Content-Type: application/json' --header 'Accept: */*' -d '{
  "colour": "red",
  "expirationDate": "2020-11-06",
  "expirationDateTime": "2020-11-06T05:43:27.909Z",
  "kind": "apple",
  "size": "small",
  "weight": "light"
}' 'http://localhost:8080/badges'

Test the Badge microservice by running the executable specification

You can use the Cucumber project to validate the API implementation. Do this when the server is up and running.

cd cd badges-specs/
mvn clean test

You will see the test results in the console, but you can also open the file located in ./target/cucumber

gamification-engine's People

Contributors

g-houlmann avatar linois avatar mauricelehmann avatar reutelerr avatar wasadigi avatar

Watchers

 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.