@Test void spaceUsedByShouldReturnZeroByDefault() { assertThat(sieveQuotaDAO.spaceUsedBy(USERNAME).block()).isEqualTo(0); }
public Mono<Long> spaceUsedBy(Username username) { return cassandraAsyncExecutor.executeSingleRowOptional( selectSpaceUsedByUserStatement.bind() .setString(CassandraSieveSpaceTable.USER_NAME, username.asString())) .map(optional -> optional.map(row -> row.getLong(CassandraSieveSpaceTable.SPACE_USED)) .orElse(0L)); }
CassandraSieveQuotaDAO { public Mono<Long> spaceUsedBy(Username username) { return cassandraAsyncExecutor.executeSingleRowOptional( selectSpaceUsedByUserStatement.bind() .setString(CassandraSieveSpaceTable.USER_NAME, username.asString())) .map(optional -> optional.map(row -> row.getLong(CassandraSieveSpaceTable.SPACE_USED)) .orElse(0L)); } }
CassandraSieveQuotaDAO { public Mono<Long> spaceUsedBy(Username username) { return cassandraAsyncExecutor.executeSingleRowOptional( selectSpaceUsedByUserStatement.bind() .setString(CassandraSieveSpaceTable.USER_NAME, username.asString())) .map(optional -> optional.map(row -> row.getLong(CassandraSieveSpaceTable.SPACE_USED)) .orElse(0L)); } @Inject  CassandraSieveQuotaDAO(Session session); }
CassandraSieveQuotaDAO { public Mono<Long> spaceUsedBy(Username username) { return cassandraAsyncExecutor.executeSingleRowOptional( selectSpaceUsedByUserStatement.bind() .setString(CassandraSieveSpaceTable.USER_NAME, username.asString())) .map(optional -> optional.map(row -> row.getLong(CassandraSieveSpaceTable.SPACE_USED)) .orElse(0L)); } @Inject  CassandraSieveQuotaDAO(Session session); Mono<Long> spaceUsedBy(Username username); Mono<Void> updateSpaceUsed(Username username, long spaceUsed); Mono<Optional<QuotaSizeLimit>> getQuota(); Mono<Void> setQuota(QuotaSizeLimit quota); Mono<Void> removeQuota(); Mono<Optional<QuotaSizeLimit>> getQuota(Username username); Mono<Void> setQuota(Username username, QuotaSizeLimit quota); Mono<Void> removeQuota(Username username); }
CassandraSieveQuotaDAO { public Mono<Long> spaceUsedBy(Username username) { return cassandraAsyncExecutor.executeSingleRowOptional( selectSpaceUsedByUserStatement.bind() .setString(CassandraSieveSpaceTable.USER_NAME, username.asString())) .map(optional -> optional.map(row -> row.getLong(CassandraSieveSpaceTable.SPACE_USED)) .orElse(0L)); } @Inject  CassandraSieveQuotaDAO(Session session); Mono<Long> spaceUsedBy(Username username); Mono<Void> updateSpaceUsed(Username username, long spaceUsed); Mono<Optional<QuotaSizeLimit>> getQuota(); Mono<Void> setQuota(QuotaSizeLimit quota); Mono<Void> removeQuota(); Mono<Optional<QuotaSizeLimit>> getQuota(Username username); Mono<Void> setQuota(Username username, QuotaSizeLimit quota); Mono<Void> removeQuota(Username username);  }