@Test
  public void useServiceWithoutInitTest() throws Exception {
    refreshState(false, true, false);
    compactor = getCompactor(state.log, DISK_IO_SCHEDULER, null, false);
    LogSegmentName firstSegmentName = state.log.getFirstSegment().getName();
    CompactionDetails details =
        new CompactionDetails(state.time.milliseconds(), Collections.singletonList(firstSegmentName), null);

    try {
      compactor.compact(details, bundleReadBuffer);
      fail("Should have failed to do anything because compactor has not been initialized");
    } catch (IllegalStateException e) {
      // expected. Nothing to do.
    }

    // create compaction log so that resumeCompaction() thinks there is a compaction in progress
    try (CompactionLog cLog = new CompactionLog(tempDirStr, STORE_ID, state.time, details, config)) {
      compactor.resumeCompaction(bundleReadBuffer);
      fail("Should have failed to do anything because compactor has not been initialized");
    } catch (IllegalStateException e) {
      // expected. Nothing to do.
    }
  }
Tests attempt to use the service without initializing the service.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java