DefaultCouchbaseBucketManagerFactory implements CouchbaseBucketManagerFactory { @Override public CouchbaseBucketManager getBucketManager(String bucketName) { requireNonNull(bucketName, "bucket is required"); return new CouchbaseBucketManager(getBucket(bucketName), bucketName); } DefaultCouchbaseBucketManagerFactory(CouchbaseCluster couchbaseCluster, String user, String password); @Override CouchbaseBucketManager getBucketManager(String bucketName); @Override Map<K, V> getMap(String bucketName, Class<K> keyValue, Class<V> valueValue); @Override Map<K, V> getMap(String bucketName, String key, Class<K> keyValue, Class<V> valueValue); @Override Queue<T> getQueue(String bucketName, Class<T> clazz); @Override Set<T> getSet(String bucketName, Class<T> clazz); @Override List<T> getList(String bucketName, Class<T> clazz); @Override Queue<T> getQueue(String bucketName, String key, Class<T> clazz); @Override Set<T> getSet(String bucketName, String key, Class<T> clazz); @Override List<T> getList(String bucketName, String key, Class<T> clazz); @Override void close();  }
@Test public void shouldReturnManager() { BucketManager database = factory.getBucketManager(CouchbaseUtil.BUCKET_NAME); assertNotNull(database); }
@Test public void shouldReturnError() { assertThrows(NullPointerException.class, () -> factory.getBucketManager(null)); }