### Question:
ContextsJaxrsService { @GET @Path("/{uuid}/metadata") public Response getContextMetadata(@PathParam("uuid") UUID uuid, @Context HttpServletRequest request) { final Object contextMetadata = contextsManager.getContextMetadata(uuid, request.getParameterMap()); if (contextMetadata == null) { return Response.status(Response.Status.NO_CONTENT).build(); } final String metadataClientResourceType = contextsManager .getMetadataClientResourceType(contextsManager.getContext(uuid, request.getParameterMap())); return Response.ok(contextMetadata, clientTypeToMimeType(metadataClientResourceType)).build(); }  @POST Response createContext(InputStream stream, @HeaderParam(HttpHeaders.CONTENT_TYPE) MediaType mediaType,
            @HeaderParam(HttpHeaders.ACCEPT) MediaType accept, @Context HttpServletRequest request, @Context UriInfo uriInfo); @GET @Path("/{uuid}") @Produces({MediaType.APPLICATION_JSON}) Response getContextDetails(@PathParam("uuid") UUID uuid,
            @Context HttpServletRequest request); @DELETE @Path("/{uuid}") Response removeContextDetails(@PathParam("uuid") UUID uuid); @GET @Path("/{uuid}/metadata") Response getContextMetadata(@PathParam("uuid") UUID uuid, @Context HttpServletRequest request); @POST @Path("/{uuid}/metadata") Response getContextMetadata(@PathParam("uuid") UUID uuid, InputStream stream,
            @HeaderParam(HttpHeaders.CONTENT_TYPE) MediaType mediaType);  }### Answer:
@Test(expectedExceptions = UnsupportedMediaTypeException.class) public void getConnectionMetadata_notSupportedType_exception() throws IOException { doReturn(null).when(contextsManager).getMetadataParamsClass("application/connections.notExistentType+xml"); service.getContextMetadata(UUID.randomUUID(), inputStream, MediaType.valueOf("application/connections.notExistentType+xml")); }