@Test
  public void disableUndeleteTest() throws Exception {
    assumeTrue(!enableUndeleteTested);
    enableUndeleteTested = true;
    File trustStoreFile = File.createTempFile("truststore", ".jks");
    trustStoreFile.deleteOnExit();
    VerifiableProperties vprop =
        buildFrontendVProps(trustStoreFile, false, PLAINTEXT_SERVER_PORT + 100, SSL_SERVER_PORT + 100);

    RestServer ambryRestServer = new RestServer(vprop, CLUSTER_MAP, new LoggingNotificationSystem(),
        SSLFactory.getNewInstance(new SSLConfig(vprop)));
    ambryRestServer.start();
    NettyClient plaintextNettyClient = new NettyClient("localhost", PLAINTEXT_SERVER_PORT + 100, null);
    NettyClient sslNettyClient = new NettyClient("localhost", SSL_SERVER_PORT + 100,
        SSLFactory.getNewInstance(new SSLConfig(SSL_CLIENT_VERIFIABLE_PROPS)));
    NettyClient nettyClient = useSSL ? sslNettyClient : plaintextNettyClient;

    String blobId = "randomblobid";
    HttpHeaders headers = new DefaultHttpHeaders();
    headers.set(RestUtils.Headers.BLOB_ID, addClusterPrefix ? "/" + CLUSTER_NAME + blobId : blobId);
    headers.set(RestUtils.Headers.SERVICE_ID, "updateBlobTtlAndVerify");
    FullHttpRequest httpRequest = buildRequest(HttpMethod.PUT, "/" + Operations.UNDELETE, headers, null);
    ResponseParts responseParts = nettyClient.sendRequest(httpRequest, null, null).get();
    HttpResponse response = getHttpResponse(responseParts);
    assertEquals("Unexpected response status", HttpResponseStatus.BAD_REQUEST, response.status());

    plaintextNettyClient.close();
    sslNettyClient.close();
    ambryRestServer.shutdown();
  }
Test when the undelete is disabled.
ambry-frontend/src/integration-test/java/com/github/ambry/frontend/FrontendIntegrationTest.java