@Override public int getStatus() { return delegate.getStatus(); }
@Override public int getStatus() { return delegate.getStatus(); }
@Override public int getStatus() { return delegate.getStatus(); }
/** * Matches all responses with the given status. */ public static WhitelistRule responseStatusIs(final int status) { return new PrintableWhitelistRule( "Response status is " + status, (message, operation, request, response) -> response != null && response.getStatus() == status); }
/** * Matches all responses with the given status type. */ public static WhitelistRule responseStatusTypeIs(final StatusType statusType) { return new PrintableWhitelistRule( "Response status is " + statusType, (message, operation, request, response) -> response != null && statusType.matches(response.getStatus())); }
@Nullable private ApiResponse getApiResponse(final Response response, final ApiOperation apiOperation) { final ApiResponse apiResponse = apiOperation.getOperation().getResponses().get(Integer.toString(response.getStatus())); if (apiResponse == null) { return apiOperation.getOperation().getResponses().getDefault(); } return apiResponse; } }
@Nullable private ApiResponse getApiResponse(final Response response, final ApiOperation apiOperation) { final ApiResponse apiResponse = apiOperation.getOperation().getResponses().get(Integer.toString(response.getStatus())); if (apiResponse == null) { return apiOperation.getOperation().getResponses().get("default"); // try the default response } return apiResponse; }
return ValidationReport.singleton( messages.get("validation.response.status.unknown", response.getStatus(), apiOperation.getApiPath().original()) ).withAdditionalContext(contextBuilder.build()); .withAdditionalContext( contextBuilder .withResponseStatus(response.getStatus()) .withApiResponseDefinition(apiResponse) .build()