@Test public void test_saveDocument_new() throws UnstorableObjectException { IDocument doc = new Document(); doc.setId("id"); docDatabaseClientToTest.saveDocument(doc); Mockito.verify(em).persist(doc); Mockito.verify(em).flush();; }
@Override public IDocument saveDocument(IDocument document) throws UnstorableObjectException { IDocument existing = getById(document.getId()); if (existing == null) { return store(document); } return update(document); }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public IDocument saveDocument(IDocument document) throws UnstorableObjectException { IDocument existing = getById(document.getId()); if (existing == null) { return store(document); } return update(document); } }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public IDocument saveDocument(IDocument document) throws UnstorableObjectException { IDocument existing = getById(document.getId()); if (existing == null) { return store(document); } return update(document); }  }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public IDocument saveDocument(IDocument document) throws UnstorableObjectException { IDocument existing = getById(document.getId()); if (existing == null) { return store(document); } return update(document); }  @Override IDocument saveDocument(IDocument document); @Override IDocument getDocumentById(String id); @Override List<IDocument> getDocumentByUploadId(String uploadId); @Override List<IDocument> getDocumentsByUsername(String username); }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public IDocument saveDocument(IDocument document) throws UnstorableObjectException { IDocument existing = getById(document.getId()); if (existing == null) { return store(document); } return update(document); }  @Override IDocument saveDocument(IDocument document); @Override IDocument getDocumentById(String id); @Override List<IDocument> getDocumentByUploadId(String uploadId); @Override List<IDocument> getDocumentsByUsername(String username);  }