Skip to content

Enhancing unit tests using gorilla/mux #58

@fear-the-reaper

Description

@fear-the-reaper

Since we are using Go's httptest to simulate our IntelOwl server through by creating a mock test server from httptest.Server and using httptest.ServeMux as a router to implement our mock responses on the specified endpoint

Right now we need are initializing the test server with every test. By using gorilla/mux we can implement a request method-based router from which we only need to set up the test server once and keep using that for every test!

To implement a common setup and teardown we can use TestMain. For more information, you can read about it here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions