@Test
  public void testCleanupBlobStaleCase1() throws Exception {
    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
    calendar.add(Calendar.DATE, -config.staleDataRetentionDays);
    long staleCutoffTime = calendar.getTimeInMillis();

    Account account = accountService.getAllAccounts().iterator().next();
    Container container = account.getAllContainers().iterator().next();
    String blobId = getBlobId(account, container);
    String blobName = "stale/" + "case1" + "/more path segments--";
    NamedBlobRecord record =
        new NamedBlobRecord(account.getName(), container.getName(), blobName, blobId, Utils.Infinite_Time);

    time.setCurrentMilliseconds(staleCutoffTime);
    namedBlobDb.put(record, NamedBlobState.IN_PROGRESS, true).get();

    List<StaleNamedBlob> staleNamedBlobs = namedBlobDb.pullStaleBlobs().get();
    assertEquals("Stale blob case 1 count does not match!", 1, staleNamedBlobs.size());
    assertEquals("Stale blob case 1 pulled out blob name does not meet expectation",
        staleNamedBlobs.get(0).getBlobName(), record.getBlobName());
    assertEquals("Stale blob case 1 pulled out blob id does not meet expectation", staleNamedBlobs.get(0).getBlobId(),
        record.getBlobId());
  }
Test behavior with blob cleanup for stale blob case
Case 1. created more than staleDataRetentionDays ago, InProgress, is Largest (Don't care about the ttl and delete)
ambry-named-mysql/src/integration-test/java/com/github/ambry/named/MySqlNamedBlobDbIntegrationTest.java