use of jakarta.nosql.keyvalue.BucketManager in project jnosql-diana by eclipse.
the class DefaultKeyValueTemplateProducerTest method shouldReturn.
@Test
public void shouldReturn() {
BucketManager manager = Mockito.mock(BucketManager.class);
KeyValueTemplate repository = producer.get(manager);
assertNotNull(repository);
}
use of jakarta.nosql.keyvalue.BucketManager in project jnosql-diana by eclipse.
the class MockProducer method getBucketManager.
@Produces
public BucketManager getBucketManager() {
BucketManager bucketManager = Mockito.mock(BucketManager.class);
Person person = Person.builder().withName("Default").build();
when(bucketManager.get("key")).thenReturn(Optional.ofNullable(Value.of(person)));
when(bucketManager.get(10L)).thenReturn(Optional.ofNullable(Value.of(person)));
when(bucketManager.get("user")).thenReturn(Optional.of(Value.of(new User("Default", "Default", 10))));
return bucketManager;
}
use of jakarta.nosql.keyvalue.BucketManager in project jnosql-diana by eclipse.
the class MockProducer method getBucketManagerMock.
@Produces
@Database(value = DatabaseType.KEY_VALUE, provider = "keyvalueMock")
public BucketManager getBucketManagerMock() {
BucketManager bucketManager = Mockito.mock(BucketManager.class);
Person person = Person.builder().withName("keyvalueMock").build();
when(bucketManager.get("key")).thenReturn(Optional.ofNullable(Value.of(person)));
when(bucketManager.get(10L)).thenReturn(Optional.ofNullable(Value.of(person)));
when(bucketManager.get("user")).thenReturn(Optional.of(Value.of(new User("keyvalueMock", "keyvalueMock", 10))));
return bucketManager;
}
use of jakarta.nosql.keyvalue.BucketManager in project jnosql-diana-driver by eclipse.
the class CouchbaseMapTest method afterClass.
@AfterAll
public static void afterClass() {
CouchbaseKeyValueConfiguration configuration = CouchbaseKeyValueTcConfiguration.getTcConfiguration();
BucketManagerFactory keyValueEntityManagerFactory = configuration.get();
BucketManager keyValueEntityManager = keyValueEntityManagerFactory.getBucketManager(CouchbaseUtil.BUCKET_NAME);
keyValueEntityManager.delete("jnosql:map");
}
use of jakarta.nosql.keyvalue.BucketManager in project jnosql-diana-driver by eclipse.
the class CouchbaseSetTest method afterClass.
@AfterAll
public static void afterClass() {
CouchbaseKeyValueConfiguration configuration = CouchbaseKeyValueTcConfiguration.getTcConfiguration();
BucketManagerFactory keyValueEntityManagerFactory = configuration.get();
BucketManager keyValueEntityManager = keyValueEntityManagerFactory.getBucketManager(CouchbaseUtil.BUCKET_NAME);
keyValueEntityManager.delete("jnosql:set");
}
Aggregations