}
@Test
public void testGetAuthorizationById() {
Authorization authorization = MockProvider.createMockGlobalAuthorization();
AuthorizationQuery authorizationQuery = mock(AuthorizationQuery.class);
when(authorizationServiceMock.createAuthorizationQuery()).thenReturn(authorizationQuery);
when(authorizationQuery.authorizationId(MockProvider.EXAMPLE_AUTHORIZATION_ID)).thenReturn(authorizationQuery);
when(authorizationQuery.singleResult()).thenReturn(authorization);
given()
.pathParam("id", MockProvider.EXAMPLE_AUTHORIZATION_ID)
.then().expect()
.statusCode(Status.OK.getStatusCode()).contentType(ContentType.JSON)
.body("id", equalTo(authorization.getId()))
.body("type", equalTo(authorization.getAuthorizationType()))
.body("permissions[0]", equalTo(Permissions.READ.getName()))
.body("permissions[1]", equalTo(Permissions.UPDATE.getName()))
.body("userId", equalTo(authorization.getUserId()))
.body("groupId", equalTo(authorization.getGroupId()))
.body("resourceType", equalTo(authorization.getResourceType()))
.body("resourceId", equalTo(authorization.getResourceId()))
.when()
.get(AUTH_RESOURCE_PATH);
}