@Test
  public void testStripPrefixAndExtension() throws Exception {
    String EXTENSION = ".bin";
    Properties properties = new Properties();
    properties.setProperty("frontend.path.prefixes.to.remove", PATH_PREFIX_TO_REMOVE);
    initNamedBlobPutHandler(properties);

    String blobId = CLUSTER_NAME + "/" + CONVERTED_ID + EXTENSION;
    assertEquals("Blob Id should not have prefix and extention", CONVERTED_ID,
        namedBlobPutHandler.stripPrefixAndExtension(blobId));

    blobId = PATH_PREFIX_TO_REMOVE + "/" + CLUSTER_NAME + "/" + CONVERTED_ID + EXTENSION;
    assertEquals("Blob Id should not have prefix and extention", CONVERTED_ID,
        namedBlobPutHandler.stripPrefixAndExtension(blobId));

    blobId = "/" + CONVERTED_ID + EXTENSION;
    assertEquals("Blob Id should not have prefix and extention", CONVERTED_ID,
        namedBlobPutHandler.stripPrefixAndExtension(blobId));
  }
Allow non-upsert put for container with NamedBlobMode = NO_UPDATE
ambry-frontend/src/test/java/com/github/ambry/frontend/NamedBlobPutHandlerTest.java