BlobStoreDeletedMessageVault implements DeletedMessageVault { @Override public Publisher<DeletedMessage> search(Username username, Query query) { Preconditions.checkNotNull(username); Preconditions.checkNotNull(query); return metricFactory.decoratePublisherWithTimerMetric( SEARCH_METRIC_NAME, searchOn(username, query)); } @Inject  BlobStoreDeletedMessageVault(MetricFactory metricFactory, DeletedMessageMetadataVault messageMetadataVault,
                                        BlobStore blobStore, BlobStoreDAO blobStoreDAO, BucketNameGenerator nameGenerator,
                                        Clock clock,
                                        RetentionConfiguration retentionConfiguration); @Override Publisher<Void> append(DeletedMessage deletedMessage, InputStream mimeMessage); @Override Publisher<InputStream> loadMimeMessage(Username username, MessageId messageId); @Override Publisher<DeletedMessage> search(Username username, Query query); @Override Publisher<Void> delete(Username username, MessageId messageId); @Override Task deleteExpiredMessagesTask();  }
@Test void searchShouldPublishSearchTimerMetrics() { Mono.from(messageVault.search(USERNAME, ALL)) .block(); Mono.from(messageVault.search(USERNAME, ALL)) .block(); assertThat(metricFactory.executionTimesFor(SEARCH_METRIC_NAME)) .hasSize(2); }