A Go library help testing your RESTful API application

Overview

RESTit Travis test Appveyor test

A Go micro-framework to help writing RESTful API integration test

Package RESTit provides helps to those who want to write an integration test program for their JSON-based RESTful APIs.

The aim is to make these integration readable highly re-usable, and yet easy to modify.

Versions

Different version of RESTit library will go under different directory.

This library is under major rewrite. The old version (version 1) is consider API stable and will only receive bug fixes. Development version (version 2) is under active development and will have new features (which may break API).

For more information, please read the README.md of these version:

Bug Reports

To report issue, please visit the issue tracker.

And of course, patches and pull requests are most welcome.

Comments
  • Work with httptest package

    Work with httptest package

    RESTit is based on napping, which generates real http requests. It aims to be a real REST client, so that isn't its problem. But RESTit aims to be a testing library, it would be nice if it can work with fake server created by core httptest package.

    To do so, I can think of 2 possible options:

    1. Rewrite the connection layer without napping.
    2. Find a way to get napping's resulting http request (of the http package) so it could be send to test server.
    enhancement 
    opened by yookoala 3
  •  Fix `PatchWith()` use of the `Updated` field in `example1.go`

    Fix `PatchWith()` use of the `Updated` field in `example1.go`

    The PatchWith() implementation of server.Patchable interface in example1.go improperly ignored the value given for the Updated field when the Created field was not set.

    opened by antichris 1
  • Problem dealing with null value

    Problem dealing with null value

    While using restit with one of my project, an uncanny bug comes out when the system gets a JSON response like this:

    {"Status": "OK", "Results": null}
    

    The Results field is supposed to be an array. The problem comes when I tried to decode the above respose to this structure:

    type MyResponse struct {
        Status  string
        Results []Item
    }
    

    Turns out that when encountering a null value in Results, json decoder wouldn't do anything to the existing field. So when I reuse a MyResponse variable over several tests, some test fails when the current JSON is null and there are previous value in MyResponse.Results field.

    restit needs to reset the result at the beginning of the test (when Run or RunOrPanic).

    bug 
    opened by yookoala 1
  • Service: add PATCH  verb/method

    Service: add PATCH verb/method

    Since current Service.Update always sends a PUT request, to test REST API endpoints that take PATCH requests, a support for PATCH HTTP verb/method must be implemented.

    opened by antichris 0
  • Better log message / error format

    Better log message / error format

    Errors return by CaseHandler should give a better idea of what the error is about.

    An error should include:

    1. The endpoint URL description (what).
    2. The method that applied to the endpoint (action).
    3. The payload, if any, sent to the endpoint (action details).
    4. The expectation (what is the expected result).
    5. The result (what is the actual result).
    6. An error involves a JSON should also describe clearly the path of the expected value / the result.
    enhancement 
    opened by yookoala 0
  • Have standard HTTP methods as name of CaseHandler

    Have standard HTTP methods as name of CaseHandler

    As suggested in #4, will have Get, Put, Post, Option, Patch as method name of the CaseHandler interface (could be alias of current Create, Update methods).

    Makes the API easier to learn

    enhancement 
    opened by yookoala 0
  • Improvement needed.

    Improvement needed.

    Hi.

    I was searching for a REST testing framework for Go and found your project. Unfortunately, it is not a good idea to use it for these few reasons (just from what I have observed when reading the docs):

    • it lacks testing OPTIONS, HEAD and most importantly PATCH requests
    • the method names are cumbersome, one have to think that List is for GET, Create is for POST, etc. - why not naming the methods with the real REST verbs?

    It would be a good idea (IMHO) to implement this into v2 since it's still in development.

    opened by shadyyx 1
Owner
RESTit
RESTit
A yaml data-driven testing format together with golang testing library

Specimen Yaml-based data-driven testing Specimen is a yaml data format for data-driven testing. This enforces separation between feature being tested

Design it, Run it 0 Jan 31, 2022
Terminal application used for API testing

Easily create, manage and execute http requests from the terminal.

PierreKieffer 62 Aug 22, 2022
siusiu (suite-suite harmonics) a suite used to manage the suite, designed to free penetration testing engineers from learning and using various security tools, reducing the time and effort spent by penetration testing engineers on installing tools, remembering how to use tools.

siusiu (suite-suite harmonics) a suite used to manage the suite, designed to free penetration testing engineers from learning and using various security tools, reducing the time and effort spent by penetration testing engineers on installing tools, remembering how to use tools.

Re 277 Sep 30, 2022
ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format

ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format. This service can then simply be consumed by any client to get the expected response.

Sumit Tokkar 3 Mar 2, 2021
A next-generation testing tool. Orion provides a powerful DSL to write and automate your acceptance tests

Orion is born to change the way we implement our acceptance tests. It takes advantage of HCL from Hashicorp t o provide a simple DSL to write the acceptance tests.

Wesovi Labs 45 Aug 31, 2022
Expressive end-to-end HTTP API testing made easy in Go

baloo Expressive and versatile end-to-end HTTP API testing made easy in Go (golang), built on top of gentleman HTTP client toolkit. Take a look to the

Tom 739 Sep 14, 2022
API testing framework inspired by frisby-js

frisby REST API testing framework inspired by frisby-js, written in Go Proposals I'm starting to work on frisby again with the following ideas: Read s

_Hofstadter 272 Sep 2, 2022
Testing API Handler written in Golang.

Gofight API Handler Testing for Golang Web framework. Support Framework Http Handler Golang package http provides HTTP client and server implementatio

Bo-Yi Wu 425 Sep 2, 2022
End-to-end HTTP and REST API testing for Go.

httpexpect Concise, declarative, and easy to use end-to-end HTTP and REST API testing for Go (golang). Basically, httpexpect is a set of chainable bui

Victor Gaydov 2k Sep 18, 2022
Hsuan-Fuzz: REST API Fuzzing by Coverage Level Guided Blackbox Testing

Hsuan-Fuzz: REST API Fuzzing by Coverage Level Guided Blackbox Testing Architecture Usage package main import ( restAPI "github.com/iasthc/hsuan-

Chung-Hsuan Tsai 21 Jul 13, 2022
mock server to aid testing the jaguar-java client API

stripe-mock stripe-mock is a mock HTTP server that responds like the real Stripe API. It can be used instead of Stripe's test mode to make test suites

knr.data 1 Dec 24, 2021
Testy is a Go test running framework designed for Gametime's API testing needs.

template_library import "github.com/gametimesf/template_library" Overview Index Overview Package template_library is a template repository for buildin

Gametime United, Inc. 4 Jun 21, 2022
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Fortio Fortio (Φορτίο) started as, and is, Istio's load testing tool and now graduated to be its own project. Fortio is also used by, among others, Me

Fortio (Φορτίο) 2.7k Sep 21, 2022
:exclamation:Basic Assertion Library used along side native go testing, with building blocks for custom assertions

Package assert Package assert is a Basic Assertion library used along side native go testing Installation Use go get. go get github.com/go-playground/

Go Playgound 46 Sep 14, 2022
Library created for testing JSON against patterns.

Gomatch Library created for testing JSON against patterns. The goal was to be able to validate JSON focusing only on parts essential in given test cas

null 43 Sep 27, 2022
testcase is an opinionated behavior-driven-testing library

Table of Contents testcase Guide Official API Documentation Getting Started / Example Modules Summary DRY Modularization Stability Case Study About te

Adam Luzsi 100 Sep 27, 2022
HTTP load testing tool and library. It's over 9000!

Vegeta Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a

Tomás Senart 20.2k Oct 1, 2022
A WebDriver client and acceptance testing library for Go

Agouti Agouti is a library for writing browser-based acceptance tests in Google Go. It provides Gomega matchers and plays nicely with Ginkgo or Spec.

Stephen Levine 803 Sep 22, 2022
Go library for testing async behavior

Helpers for testing async behavior.

Nick Stogner 1 Jun 30, 2022