DefaultDisseminationHandler implements DisseminationHandler { public void setIconAsDissemination(MediaType origMime, String dsLabel, String message) throws DigitalObjectException { setIconAsDissemination(dsId, origMime, dsLabel, message); } DefaultDisseminationHandler(String dsId, DigitalObjectHandler handler); String getDsId(); DigitalObjectHandler getHandler(); @Override Response getDissemination(Request httpRequest); static Response getResponse(RemoteObject remote, String dsId); @Override void setDissemination(DisseminationInput input, String message); @Override void deleteDissemination(String message); void setRawDissemination(File contents, String filename, MediaType mime, String message); void setPreviewDissemination(File contents, String filename, MediaType mime, String message); void setIconAsDissemination(MediaType origMime, String dsLabel, String message); void setIconAsDissemination(String dsId, MediaType origMime, String dsLabel, String message); void setDsDissemination(String dsId, File contents, String filename, MediaType mime, String message);  }
@Test public void testSetIconAsDissemination() throws Exception { final MediaType mime = new MediaType("application", "pdf"); final String dsId = BinaryEditor.PREVIEW_ID; assumeIcon(mime, dsId); final DigitalObjectHandler pageObject = new DigitalObjectHandler(robject, null); DefaultDisseminationHandler handler = new DefaultDisseminationHandler(dsId, pageObject); String t = test.getMethodName(); handler.setIconAsDissemination(dsId, mime, BinaryEditor.PREVIEW_LABEL, t); pageObject.commit(); Response response = handler.getDissemination(null); assertNotNull(robject.getPid(), response); assertEquals(robject.getPid(), Status.OK.getStatusCode(), response.getStatus()); }