@Override public String getMimeType(Object value, Operation operation) throws ServiceException { String mimeType = ((RepositoryItem) value).getMime(); return mimeType; }
@Override public String getMimeType(Object value, Operation operation) throws ServiceException { String mimeType = ((RepositoryItem) value).getMime(); return mimeType; }
@Test public void testGetRepositoryItem() throws IOException { RepositoryItem item = store.getRepositoryItem("foo"); assertNull(item); item = store.getRepositoryItem("urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f"); assertNotNull(item); assertEquals("application/xml", item.getMime()); String contents = IOUtils.toString(item.getContents(), "UTF-8"); String expected = "This is a random comment that will show up only when fetching the repository item"; assertTrue(contents.contains(expected)); } }