diff --git a/client_test.go b/client_test.go index 3d93234..a4feb64 100644 --- a/client_test.go +++ b/client_test.go @@ -529,7 +529,7 @@ func TestClient_GetBusinessDays(t *testing.T) { }{ "Normal case": {endpoint: srv.URL, token: "opencollector", ctx: context.Background(), giveTime: time.UnixMilli(1672498800000), checkAsError: false, wantError: nil, wantResult: true}, "Empty case": {endpoint: srv.URL, token: "opencollector", ctx: context.Background(), giveTime: time.Time{}, checkAsError: true, wantError: kenall.ErrInvalidArgument, wantResult: false}, - "Wrong response": {endpoint: srv.URL, token: "opencollector", ctx: context.Background(), giveTime: time.Time{}.Add(time.Hour), checkAsError: true, wantError: &json.MarshalerError{}, wantResult: false}, + "Wrong response": {endpoint: srv.URL, token: "opencollector", ctx: context.Background(), giveTime: time.Time{}.Add(24 * time.Hour), checkAsError: true, wantError: &json.MarshalerError{}, wantResult: false}, "nil context": {endpoint: srv.URL, token: "opencollector", ctx: nil, giveTime: time.Now(), checkAsError: true, wantError: &url.Error{}, wantResult: false}, } @@ -925,6 +925,10 @@ func handleBusinessDaysAPI(t *testing.T, w http.ResponseWriter, uri string) { if _, err := w.Write(businessDaysResponse); err != nil { w.WriteHeader(http.StatusInternalServerError) } + case "/businessdays/check?date=0001-01-02": + if _, err := w.Write([]byte(`{"result": "worng"}`)); err != nil { + w.WriteHeader(http.StatusInternalServerError) + } default: w.WriteHeader(http.StatusNotFound) }