Skip to content

Commit

Permalink
Format ApiErrorBodyDeserializationSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
Costin Chiulan committed Sep 25, 2024
1 parent 6870c7d commit e9be66c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ void handleUnexpectedFieldsInErrorResponse() throws JsonProcessingException {
void handleNullMetadataFieldInErrorResponse() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
String rawResponse =
"{\"error_code\":\"METASTORE_DOES_NOT_EXIST\",\"message\":\"No metastore assigned for the current workspace.\",\"details\":[{\"@type\":\"type.googleapis.com/google.rpc.RequestInfo\",\"request_id\":\"1888e822-f1b5-4996-85eb-0d2b5cc402e6\",\"serving_data\":\"\"}]}";
"{\"error_code\":\"METASTORE_DOES_NOT_EXIST\",\"message\":\"No metastore assigned for the current workspace.\",\"details\":[{\"@type\":\"type.googleapis.com/google.rpc.RequestInfo\",\"request_id\":\"1888e822-f1b5-4996-85eb-0d2b5cc402e6\",\"serving_data\":\"\"}]}";
ApiErrorBody error = mapper.readValue(rawResponse, ApiErrorBody.class);

assertEquals(error.getErrorCode(), "METASTORE_DOES_NOT_EXIST");
assertEquals(error.getMessage(), "No metastore assigned for the current workspace.");
}

}

0 comments on commit e9be66c

Please sign in to comment.