Sha256: c3dc60776a0673d1030b9ce78e504dabb360148dd88da46cc4625f579adf07d3

Contents?: true

Size: 609 Bytes

Versions: 3

Compression:

Stored size: 609 Bytes

Contents

package handlers

import (
	"net/http"
	"net/http/httptest"
	"testing"

	log "github.com/Sirupsen/logrus"

	"github.com/stretchr/testify/assert"
)

func healthTestSetup(t *testing.T) http.Handler {
	return newHealthHandler(healthHandlerDependencies{
		logger: &log.Logger{},
	})
}

// Simple test to show how we can use the ResponseRecorder to test our HTTP handlers
func TestHealthHandler(t *testing.T) {
	handler := healthTestSetup(t)

	var responseRecorder httptest.ResponseRecorder
	var request http.Request

	handler.ServeHTTP(&responseRecorder, &request)

	assert.Equal(t, 200, responseRecorder.Code)
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minke-generator-go-0.9.3 lib/generators/gomicroservice/scaffold/handlers/health_test.go.erb
minke-generator-go-0.9.2 lib/generators/gomicroservice/scaffold/handlers/health_test.go.erb
minke-generator-go-0.9.1 lib/generators/gomicroservice/scaffold/handlers/health_test.go.erb