@Test void currentBucketShouldReturnBucketFormattedOnFirstDayOfMonth() { assertThat(DEFAULT_GENERATOR.currentBucket()) .isEqualTo(BucketName.of("deleted-messages-2007-12-01")); }
BucketName currentBucket() { ZonedDateTime now = ZonedDateTime.now(clock); int month = now.getMonthValue(); int year = now.getYear(); return BucketName.of(String.format(BUCKET_NAME_GENERATING_FORMAT, year, month)); }
BucketNameGenerator { BucketName currentBucket() { ZonedDateTime now = ZonedDateTime.now(clock); int month = now.getMonthValue(); int year = now.getYear(); return BucketName.of(String.format(BUCKET_NAME_GENERATING_FORMAT, year, month)); } }
BucketNameGenerator { BucketName currentBucket() { ZonedDateTime now = ZonedDateTime.now(clock); int month = now.getMonthValue(); int year = now.getYear(); return BucketName.of(String.format(BUCKET_NAME_GENERATING_FORMAT, year, month)); } @Inject  BucketNameGenerator(Clock clock); }
BucketNameGenerator { BucketName currentBucket() { ZonedDateTime now = ZonedDateTime.now(clock); int month = now.getMonthValue(); int year = now.getYear(); return BucketName.of(String.format(BUCKET_NAME_GENERATING_FORMAT, year, month)); } @Inject  BucketNameGenerator(Clock clock);  }
BucketNameGenerator { BucketName currentBucket() { ZonedDateTime now = ZonedDateTime.now(clock); int month = now.getMonthValue(); int year = now.getYear(); return BucketName.of(String.format(BUCKET_NAME_GENERATING_FORMAT, year, month)); } @Inject  BucketNameGenerator(Clock clock);   }