@Test public void test_getDocumentsByUsername_docExists() throws Exception { IDocument doc1 = new Document(); doc1.setId(DOC1_ID); doc1.setUsername(USERNAME); List<IDocument> result = new ArrayList<IDocument>(); result.add(doc1); IDocumentDatabaseClient partiallyMockedClient = new DocumentDatabaseClient() { @Override protected List<IDocument> searchByProperty(String propName, String propValue, Class<? extends IDocument> clazz) { return result; } }; List<IDocument> searchResult = partiallyMockedClient.getDocumentsByUsername(USERNAME); Assert.assertEquals(1, searchResult.size()); Assert.assertEquals(USERNAME, searchResult.get(0).getUsername()); }
@Override public List<IDocument> getDocumentsByUsername(String username) { return getDocumentList("username", username); }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public List<IDocument> getDocumentsByUsername(String username) { return getDocumentList("username", username); } }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public List<IDocument> getDocumentsByUsername(String username) { return getDocumentList("username", username); }  }
DocumentDatabaseClient extends DatabaseClient<IDocument> implements
        IDocumentDatabaseClient { @Override public List<IDocument> getDocumentsByUsername(String username) { return getDocumentList("username", username); }  @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 List<IDocument> getDocumentsByUsername(String username) { return getDocumentList("username", username); }  @Override IDocument saveDocument(IDocument document); @Override IDocument getDocumentById(String id); @Override List<IDocument> getDocumentByUploadId(String uploadId); @Override List<IDocument> getDocumentsByUsername(String username);  }