Skip to content

create a little MockGitHub class for tests mocking out the github REST API #382

Closed
@jstrachan

Description

there's a few projects I'd really like a simple mock implementation of GitHub for easier testing.

I'm fine with it being pretty basic (and defaulting to just not finding stuff ;) but if it was able to find users/orgs/repos/PRs and whatnot from in memory objects it'd be super handy.

I started a little spike using a real JAXRS server side and tried reusing the DTOs from this excellent library; but the way the DTOs work they are kinda hard wired into the Requestor; so figure it was maybe simplest to just add a little MockGitHub derived class. By barely changing the code I was able to get something basic going without breaking the GitHub API or implementation.

I can submit a little PR to show you the kinda thing am thinking. Its kinda an extension of the offline mode but just with a custom API that lets you populate some resources etc

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions