- assertions.Contains(responseRecorder.Body.String(), tt.wantedBody, tt.name)
- jobHandlerMock.AssertCalled(t, "AddJobFromRESTCall", tt.args.job)
+ if tt.wantedErrorInfo != nil {
+ var actualErrInfo ErrorInfo
+ err := json.Unmarshal(getBody(responseRecorder, t), &actualErrInfo)
+ if err != nil {
+ t.Error("Unable to unmarshal error body", err)
+ t.Fail()
+ }
+ assertions.Equal(*tt.wantedErrorInfo, actualErrInfo, tt.name)
+ assertions.Equal("application/problem+json", responseRecorder.Result().Header.Get("Content-Type"))
+ }
+ jobsHandlerMock.AssertCalled(t, "AddJobFromRESTCall", tt.args.job)