SpaceRest extends BaseRest { @Path("/{spaceID}") @HEAD public Response getSpaceProperties(@PathParam("spaceID") String spaceID, @QueryParam("storeID") String storeID) { String msg = "adding space properties(" + spaceID + ", " + storeID + ")"; try { log.debug(msg); return addSpacePropertiesToResponse(Response.ok(), spaceID, storeID); } catch (ResourceNotFoundException e) { return responseNotFound(msg, e, NOT_FOUND); } catch (ResourceException e) { return responseBad(msg, e, INTERNAL_SERVER_ERROR); } catch (Exception e) { return responseBad(msg, e, INTERNAL_SERVER_ERROR); } } @Autowired  SpaceRest(SpaceResource spaceResource,
                     SecurityContextUtil securityContextUtil); @Path("/spaces") @GET @Produces(XML) Response getSpaces(@QueryParam("storeID") String storeID); @Path("/{spaceID}") @GET @Produces(XML) Response getSpace(@PathParam("spaceID") String spaceID,
                             @QueryParam("storeID") String storeID,
                             @QueryParam("prefix") String prefix,
                             @QueryParam("maxResults") long maxResults,
                             @QueryParam("marker") String marker); @Path("/{spaceID}") @HEAD Response getSpaceProperties(@PathParam("spaceID") String spaceID,
                                       @QueryParam("storeID") String storeID); @Path("/acl/{spaceID}") @HEAD Response getSpaceACLs(@PathParam("spaceID") String spaceID,
                                 @QueryParam("storeID") String storeID); @Path("/{spaceID}") @PUT Response addSpace(@PathParam("spaceID") String spaceID,
                             @QueryParam("storeID") String storeID); @Path("/acl/{spaceID}") @POST Response updateSpaceACLs(@PathParam("spaceID") String spaceID,
                                    @QueryParam("storeID") String storeID); @Path("/{spaceID}") @DELETE Response deleteSpace(@PathParam("spaceID") String spaceID,
                                @QueryParam("storeID") String storeID);  }
@Test public void testGetSpaceProperties() throws Exception { createGetSpacePropertiesMocks(); Response response = spaceRest.getSpaceProperties(spaceId, storeId); Assert.assertNotNull(response); MultivaluedMap metadata = response.getMetadata(); Assert.assertNotNull(metadata); Assert.assertEquals(spaceProps.size(), metadata.size()); for (String propName : spaceProps.keySet()) { String metaName = prefix + propName; Assert.assertTrue(metadata.containsKey(metaName)); Assert.assertEquals(spaceProps.get(propName), metadata.getFirst( metaName)); } }