Make tests fail fast returning 501 Not Implemented error

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-09-05 07:38:13 +02:00
parent 07b6ce9b01
commit ec20e02534
+2 -8
View File
@@ -4,7 +4,6 @@ import (
"fmt" "fmt"
b "github.com/BBVA/kapow/pkg/banner" b "github.com/BBVA/kapow/pkg/banner"
"net/http" "net/http"
"os/exec"
) )
func main() { func main() {
@@ -22,17 +21,12 @@ type userServerHandler struct {
} }
func (m *userServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (m *userServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
out, err := exec.Command("date").Output() w.WriteHeader(http.StatusNotImplemented)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
} else {
w.Write(out)
}
} }
type controlAPIHandler struct { type controlAPIHandler struct {
} }
func (m *controlAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (m *controlAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Welcome to the control API!")) w.WriteHeader(http.StatusNotImplemented)
} }