test

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertMethod

func AssertMethod(t *testing.T, expectedMethod string, req *http.Request)

AssertMethod test that the Request has the expected http method

func AssertReqJSON

func AssertReqJSON(t *testing.T, expected map[string]interface{}, req *http.Request)

AssertReqJSON tests that the Request has the expected key values pairs json encoded in its Body

func CreateAtlasProject added in v0.0.7

func CreateAtlasProject(projectName string, groupID string, namespace string, organizationID string) *knappekv1alpha1.MongoDBAtlasProject

CreateAtlasProject returns a standard atlas project

func Server

func Server() (*http.Client, *http.ServeMux, *httptest.Server)

Server returns an http Client, ServeMux, and Server. The client proxies requests to the server and handlers can be registered on the mux to handle requests. The caller must close the test server.

Types

type RewriteTransport

type RewriteTransport struct {
	Transport http.RoundTripper
}

RewriteTransport rewrites https requests to http to avoid TLS cert issues during testing.

func (*RewriteTransport) RoundTrip

func (t *RewriteTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip rewrites the request scheme to http and calls through to the composed RoundTripper or if it is nil, to the http.DefaultTransport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL