@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testSave() throws Exception {
when(writer.insert(any(DatabaseDocument.class))).thenReturn(false);
DatabaseDocument dbdoc = mock(DatabaseDocument.class);
when(dbc.convert(any(LocalDocument.class))).thenReturn(dbdoc);
LocalDocumentID id = new LocalDocumentID(1);
when(dbdoc.getID()).thenReturn(id);
when(reader.getDocumentById(id)).thenReturn(dbdoc);
RemotePipeline rp = new HttpRemotePipeline("localhost", server.getPort(), "stage");
LocalDocument ld = new LocalDocument();