@Test
  public void undeleteRequestResponseTest() throws IOException {
    UndeleteRequest undeleteRequest = new UndeleteRequest(correlationId, clientId, blobId, System.currentTimeMillis());
    DataInputStream requestStream = serAndPrepForRead(undeleteRequest);
    MockRequest mockRequest = new MockRequest(requestStream);
    // 1. Verify request is decoded correctly
    RequestOrResponse request = requestResponseHelper.getDecodedRequest(mockRequest);
    assertEquals("Mismatch in request type", request.getRequestType(), RequestOrResponseType.UndeleteRequest);
    // 2. Verify response is formed correctly
    Response response = requestResponseHelper.createErrorResponse(request, ServerErrorCode.RetryAfterBackoff);
    assertEquals("Mismatch in response type", response.getRequestType(), RequestOrResponseType.UndeleteResponse);
    assertEquals("Mismatch in response correlation id", response.getCorrelationId(), correlationId);
    assertEquals("Mismatch in response client id", response.getClientId(), clientId);
    assertEquals("Mismatch in error code", response.getError(), ServerErrorCode.RetryAfterBackoff);
    request.release();
    response.release();
  }
Test for undelete request and response.
@throws IOException
ambry-network/src/test/java/com/github/ambry/network/ServerRequestResponseHelperTest.java