use of org.jnosql.diana.api.key.BucketManager in project jnosql-artemis 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("user")).thenReturn(Optional.of(Value.of(new User("keyvalueMock", "keyvalueMock", 10))));
return bucketManager;
}
Aggregations