Skip to content

Add HTTP-based stub manipulation endpoint #19

Open

Description

@rickb777

Idea for discussion:

We could add an endpoint that would accept GET/PUT/POST/DELETE requests 'restfully'. Under such control, the server would operate as a stubbed microservice. The purpose would be to operate as a tool during integration testing, replacing the need to stub 'normal' microservices on an ad-hoc basis.

Supposing that "/admin" is a configurable path,

POST /admin/expect/GET/uri/path

might set up a one-shot expectation akin to calling StubServer.expect. Similarly,

POST /admin/stub/GET/uri/path

might set up a multi-use expectation akin to calling StubServer.stub. In each case, The request header expectations would perhaps be included in the request entity. GET, PUT and DELETE methods might be provided for inspection and alteration.

GET /admin/verify

might be akin to calling StubServer.verify, albeit returning its outcome in JSON.

Activity

  1. tarttelin commented on Nov 9, 2016

    @tarttelin
    Owner

    Interesting. I wonder if stubby4j might be a better fit for this use-case?

  2. rickb777 commented on Nov 9, 2016

    @rickb777
    CollaboratorAuthor

    I've been thinking about stubby4j, but it's a slightly different beast. JavaStubServer could behave 'in loco' as a stub of a microservice, albeit with an HTTP-programmable behaviour and, optionally, stubbing configured at startup by a wrapper 'main'. The intent would be a drop-in replacement for a real service as a self-hosting (Jetty) service.

    Stubby4j is packaged differently.

    Perhaps I ought to try out an outline of what I have in mind via another PR.

    Perhaps it should be a separate repo that depends on JavaStubServer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions