private void signFailuresTest() throws Exception {
    AmbryUrlSigningService signer = getUrlSignerWithDefaults(new MockTime());
    // RestMethod not present
    RestRequest request = getUrlSignRequest(null, Utils.Infinite_Time, null, -1L, false);
    ensureSignedUrlCreationFailure(signer, request, RestServiceErrorCode.MissingArgs);

    // unknown RestMethod
    request = getUrlSignRequest(null, Utils.Infinite_Time, null, -1L, false);
    request.setArg(RestUtils.Headers.URL_TYPE, "@@unknown@@");
    ensureSignedUrlCreationFailure(signer, request, RestServiceErrorCode.InvalidArgs);

    // RestMethod not supported
    request = getUrlSignRequest(RestMethod.DELETE, Utils.Infinite_Time, null, -1L, false);
    ensureSignedUrlCreationFailure(signer, request, RestServiceErrorCode.InvalidArgs);

    // url ttl not long
    request = getUrlSignRequest(RestMethod.POST, Utils.Infinite_Time, null, -1L, false);
    request.setArg(RestUtils.Headers.URL_TTL, "@@notlong@@");
    ensureSignedUrlCreationFailure(signer, request, RestServiceErrorCode.InvalidArgs);

    // max upload size not long
    request = getUrlSignRequest(RestMethod.POST, Utils.Infinite_Time, null, -1L, false);
    request.setArg(RestUtils.Headers.MAX_UPLOAD_SIZE, "@@notlong@@");
    ensureSignedUrlCreationFailure(signer, request, RestServiceErrorCode.InvalidArgs);
  }
Tests for failure scenarios when trying to generate signed URLs.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbryUrlSigningServiceTest.java