This commit is contained in:
@@ -78,6 +78,26 @@ func TestGatewayRoutesProspectiveItemToContinuity(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGatewayRoutesProspectiveListToContinuity(t *testing.T) {
|
||||
continuity := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/v1/creator/prospective-items" || r.URL.RawQuery != "limit=25" {
|
||||
t.Fatalf("unexpected Continuity list target %s?%s", r.URL.Path, r.URL.RawQuery)
|
||||
}
|
||||
_, _ = io.WriteString(w, `{"Items":[]}`)
|
||||
}))
|
||||
defer continuity.Close()
|
||||
handler, err := newHandler("http://core-runtime.invalid", continuity.URL, continuity.Client())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
request := httptest.NewRequest(http.MethodGet, "/api/prospective-items?limit=25", nil)
|
||||
response := httptest.NewRecorder()
|
||||
handler.ServeHTTP(response, request)
|
||||
if response.Code != http.StatusOK || !strings.Contains(response.Body.String(), "Items") {
|
||||
t.Fatalf("response = %d %s", response.Code, response.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestConsoleAndSecurityHeaders(t *testing.T) {
|
||||
handler, err := newHandler("http://core-runtime:8080", "http://continuity-runtime:8081", http.DefaultClient)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user