GithubHelp home page GithubHelp logo

dustyjuhl / gsrestservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mlvandijk/gsrestservice

0.0 1.0 0.0 22 KB

Created a simple Spring REST Service; added several testing frameworks to test REST services for comparison

Java 86.00% Gherkin 14.00%

gsrestservice's Introduction

Getting started with REST Service and Spring

This project was started when I wanted to create a simple REST service with Spring, just for practice.

Description

Practice building a REST Web Service with Spring from tutorial: https://spring.io/guides/gs/rest-service/

How to start the application

If you are using Maven, you can run the application using 'mvn spring-boot:run'.

How to test the service (manually)

Once the project is running, go to: http://localhost:8080/greeting Expected result: {"id":1,"content":"Hello, World!"}

Provide a name query string parameter with http://localhost:8080/greeting?name=User Expected result: {"id":2,"content":"Hello, User!"}

Overview of some test frameworks to test REST Services

This simple service was used in a POC to compare several test frameworks for testing REST services.

How to test the service using cucumber from IntelliJ

  • Install the Cucumber for Java plugin in IntelliJ
  • Edit run configurations: set Glue to "cucumber.stepdefs"
  • Run the feature file Note: The application is started from the test

How to test the service using restassured

  • start the application (see above)
  • run the test (HelloWorldTest.java) in the test/java/restassured folder

How to test the service using karate

  • start the application (see above)
  • run the test either by running the .feature file from the test/resources folder or by running the test file in the test/java/karate folder

gsrestservice's People

Contributors

keetron avatar mlvandijk 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.