@Test public void should_not_create_db_if_already_exists() { doReturn(HttpResponseStub .valueOf( 200, "{\"test_db\":\"global\",\"doc_count\":1,\"doc_del_count\":0,\"update_seq\":3,\"purge_seq\":0,\"compact_running\":false,\"disk_size\":100,\"instance_start_time\":\"130\",\"disk_format_version\":5,\"committed_update_seq\":3}")) .when(httpClient).head("/test_db/"); dbCon.createDatabaseIfNotExists(); verify(httpClient, VerificationModeFactory.times(0)).put(anyString()); }
@Override public void createDatabaseIfNotExists() { dbInstance.createDatabaseIfNotExists(dbName); }
StdCouchDbConnector implements CouchDbConnector { @Override public void createDatabaseIfNotExists() { dbInstance.createDatabaseIfNotExists(dbName); } }
StdCouchDbConnector implements CouchDbConnector { @Override public void createDatabaseIfNotExists() { dbInstance.createDatabaseIfNotExists(dbName); } StdCouchDbConnector(String databaseName, CouchDbInstance dbInstance);  StdCouchDbConnector(String databaseName, CouchDbInstance dbi,
            ObjectMapperFactory om); }
StdCouchDbConnector implements CouchDbConnector { @Override public void createDatabaseIfNotExists() { dbInstance.createDatabaseIfNotExists(dbName); } StdCouchDbConnector(String databaseName, CouchDbInstance dbInstance);  StdCouchDbConnector(String databaseName, CouchDbInstance dbi,
            ObjectMapperFactory om); void setLocalBulkBuffer(LocalBulkBuffer localBulkBuffer); void setCollectionBulkExecutor(BulkExecutor<Collection<?>> collectionBulkExecutor); void setInputStreamBulkExecutor(BulkExecutor<InputStream> inputStreamBulkExecutor); void setQueryExecutor(QueryExecutor queryExecutor); @Override String path(); @Override void create(final Object o); @Override void create(String id, Object node); @Override boolean contains(String id); @Override String createAttachment(String docId, AttachmentInputStream data); @Override String createAttachment(String docId, String revision,
            AttachmentInputStream data); @Override AttachmentInputStream getAttachment(final String id,
            final String attachmentId); @Override AttachmentInputStream getAttachment(String id, String attachmentId,
    		String revision); @Override String delete(Object o); @Override PurgeResult purge(Map<String, List<String>> revisionsToPurge); @Override T get(final Class<T> c, String id); @Override T get(final Class<T> c, String id, Options options); @Override T get(final Class<T> c, String id, String rev); @Override T getWithConflicts(final Class<T> c, String id); @Override T find(Class<T> c, String id); @Override T find(final Class<T> c, String id, Options options); @Override List<Revision> getRevisions(String id); @Override String getCurrentRevision(String id); @Override InputStream getAsStream(String id); @Override InputStream getAsStream(String id, Options options); @Override InputStream getAsStream(String id, String rev); @Override void update(final Object o); @Override String delete(String id, String revision); @Override String copy(String sourceDocId, String targetDocId); @Override String copy(String sourceDocId, String targetDocId,
    		String targetRevision); @Override List<String> getAllDocIds(); @Override void createDatabaseIfNotExists(); @Override String getDatabaseName(); @Override List<T> queryView(final ViewQuery query, final Class<T> type); @Override Page<T> queryForPage(ViewQuery query, PageRequest pr, Class<T> type); @Override ViewResult queryView(final ViewQuery query); @Override StreamingViewResult queryForStreamingView(ViewQuery query); @Override InputStream queryForStream(ViewQuery query); @Override String deleteAttachment(String docId, String revision,
            String attachmentId); @Override HttpClient getConnection(); @Override DbInfo getDbInfo(); @Override Security getSecurity(); @Override Status updateSecurity(Security security); @Override DesignDocInfo getDesignDocInfo(String designDocId); @Override void compact(); @Override void cleanupViews(); @Override ReplicationStatus replicateFrom(String source); @Override ReplicationStatus replicateFrom(String source,
            Collection<String> docIds); @Override ReplicationStatus replicateTo(String target); @Override ReplicationStatus replicateTo(String target,
            Collection<String> docIds); @Override void compactViews(String designDocumentId); @Override List<DocumentOperationResult> executeAllOrNothing(InputStream inputStream); @Override List<DocumentOperationResult> executeBulk(InputStream inputStream); List<DocumentOperationResult> executeBulk(InputStream inputStream, boolean allOrNothing); @Override List<DocumentOperationResult> executeAllOrNothing(Collection<?> objects); @Override List<DocumentOperationResult> executeBulk(Collection<?> objects); @Override void addToBulkBuffer(Object o); @Override void clearBulkBuffer(); @Override List<DocumentOperationResult> flushBulkBuffer(); @Deprecated void setJsonSerializer(JsonSerializer js); List<DocumentOperationResult> executeBulk(Collection<?> objects,
			boolean allOrNothing); @Override int getRevisionLimit(); @Override void setRevisionLimit(int limit); @Override List<DocumentChange> changes(ChangesCommand cmd); @Override StreamingChangesResult changesAsStream(ChangesCommand cmd); @Override ChangesFeed changesFeed(ChangesCommand cmd); @Override String callUpdateHandler(String designDocID, String function,
            String docID); @Override String callUpdateHandler(String designDocID, String function, String docID, Map<String, String> params); @Override String callUpdateHandler(final UpdateHandlerRequest req); @Override T callUpdateHandler(final UpdateHandlerRequest req, final Class<T> c); @Override void ensureFullCommit(); @Override void updateMultipart(String id, InputStream stream, String boundary, long length, Options options); @Override void update(String id, InputStream document, long length, Options options); }
StdCouchDbConnector implements CouchDbConnector { @Override public void createDatabaseIfNotExists() { dbInstance.createDatabaseIfNotExists(dbName); } StdCouchDbConnector(String databaseName, CouchDbInstance dbInstance);  StdCouchDbConnector(String databaseName, CouchDbInstance dbi,
            ObjectMapperFactory om); void setLocalBulkBuffer(LocalBulkBuffer localBulkBuffer); void setCollectionBulkExecutor(BulkExecutor<Collection<?>> collectionBulkExecutor); void setInputStreamBulkExecutor(BulkExecutor<InputStream> inputStreamBulkExecutor); void setQueryExecutor(QueryExecutor queryExecutor); @Override String path(); @Override void create(final Object o); @Override void create(String id, Object node); @Override boolean contains(String id); @Override String createAttachment(String docId, AttachmentInputStream data); @Override String createAttachment(String docId, String revision,
            AttachmentInputStream data); @Override AttachmentInputStream getAttachment(final String id,
            final String attachmentId); @Override AttachmentInputStream getAttachment(String id, String attachmentId,
    		String revision); @Override String delete(Object o); @Override PurgeResult purge(Map<String, List<String>> revisionsToPurge); @Override T get(final Class<T> c, String id); @Override T get(final Class<T> c, String id, Options options); @Override T get(final Class<T> c, String id, String rev); @Override T getWithConflicts(final Class<T> c, String id); @Override T find(Class<T> c, String id); @Override T find(final Class<T> c, String id, Options options); @Override List<Revision> getRevisions(String id); @Override String getCurrentRevision(String id); @Override InputStream getAsStream(String id); @Override InputStream getAsStream(String id, Options options); @Override InputStream getAsStream(String id, String rev); @Override void update(final Object o); @Override String delete(String id, String revision); @Override String copy(String sourceDocId, String targetDocId); @Override String copy(String sourceDocId, String targetDocId,
    		String targetRevision); @Override List<String> getAllDocIds(); @Override void createDatabaseIfNotExists(); @Override String getDatabaseName(); @Override List<T> queryView(final ViewQuery query, final Class<T> type); @Override Page<T> queryForPage(ViewQuery query, PageRequest pr, Class<T> type); @Override ViewResult queryView(final ViewQuery query); @Override StreamingViewResult queryForStreamingView(ViewQuery query); @Override InputStream queryForStream(ViewQuery query); @Override String deleteAttachment(String docId, String revision,
            String attachmentId); @Override HttpClient getConnection(); @Override DbInfo getDbInfo(); @Override Security getSecurity(); @Override Status updateSecurity(Security security); @Override DesignDocInfo getDesignDocInfo(String designDocId); @Override void compact(); @Override void cleanupViews(); @Override ReplicationStatus replicateFrom(String source); @Override ReplicationStatus replicateFrom(String source,
            Collection<String> docIds); @Override ReplicationStatus replicateTo(String target); @Override ReplicationStatus replicateTo(String target,
            Collection<String> docIds); @Override void compactViews(String designDocumentId); @Override List<DocumentOperationResult> executeAllOrNothing(InputStream inputStream); @Override List<DocumentOperationResult> executeBulk(InputStream inputStream); List<DocumentOperationResult> executeBulk(InputStream inputStream, boolean allOrNothing); @Override List<DocumentOperationResult> executeAllOrNothing(Collection<?> objects); @Override List<DocumentOperationResult> executeBulk(Collection<?> objects); @Override void addToBulkBuffer(Object o); @Override void clearBulkBuffer(); @Override List<DocumentOperationResult> flushBulkBuffer(); @Deprecated void setJsonSerializer(JsonSerializer js); List<DocumentOperationResult> executeBulk(Collection<?> objects,
			boolean allOrNothing); @Override int getRevisionLimit(); @Override void setRevisionLimit(int limit); @Override List<DocumentChange> changes(ChangesCommand cmd); @Override StreamingChangesResult changesAsStream(ChangesCommand cmd); @Override ChangesFeed changesFeed(ChangesCommand cmd); @Override String callUpdateHandler(String designDocID, String function,
            String docID); @Override String callUpdateHandler(String designDocID, String function, String docID, Map<String, String> params); @Override String callUpdateHandler(final UpdateHandlerRequest req); @Override T callUpdateHandler(final UpdateHandlerRequest req, final Class<T> c); @Override void ensureFullCommit(); @Override void updateMultipart(String id, InputStream stream, String boundary, long length, Options options); @Override void update(String id, InputStream document, long length, Options options);  }