Make tests fail fast returning 501 Not Implemented error
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user