@Test
  public void ambryIdConverterNamedBlobTest() throws Exception {
    Properties properties = new Properties();
    VerifiableProperties verifiableProperties = new VerifiableProperties(properties);
    IdSigningService idSigningService = mock(IdSigningService.class);
    NamedBlobDb namedBlobDb = mock(NamedBlobDb.class);
    AmbryIdConverterFactory ambryIdConverterFactory =
        new AmbryIdConverterFactory(verifiableProperties, new MetricRegistry(), idSigningService, namedBlobDb);
    IdConverter idConverter = ambryIdConverterFactory.getIdConverter();
    assertNotNull("No IdConverter returned", idConverter);
    PartitionId partitionId = new MockPartitionId(partition, MockClusterMap.DEFAULT_PARTITION_CLASS);
    BlobId blobId = new BlobId(BLOB_ID_V6, BlobIdType.NATIVE, dataCenterId, accountId, containerId, partitionId, false,
        BlobDataType.DATACHUNK);

    List<String> idList = new ArrayList<>();
    idList.add(blobId.getID());

    for (String id : idList) {
      reset(idSigningService);
      reset(namedBlobDb);
      when(namedBlobDb.put(any(), any(), any())).thenReturn(
          CompletableFuture.completedFuture(new PutResult(new NamedBlobRecord("", "", "", id, Utils.Infinite_Time))));
      testConversionForNamedBlob(idConverter, RestMethod.PUT, null, id, id);
      verify(idSigningService, never()).getSignedId(any(), any());
      verify(namedBlobDb).put(any(), any(), any());
    }
  }
Test when id conversion is expected to fail
@param idConverter the {@link IdConverter} instance to use.
@param restRequest the {@link RestRequest} to use.
@param input the input string
@param expectedErrorCode the expected {@link RestServiceErrorCode}.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbryIdConverterFactoryTest.java