private void doBuildGetBlobOptionsTestForSubResource(Map<String, Object> args, RestUtils.SubResource subResource,
      ByteRange expectedRange, OperationType expectedOpType, boolean expectedResolveRangeOnEmptyBlob,
      boolean shouldSucceed) throws RestServiceException {
    if (shouldSucceed) {
      GetBlobOptions options =
          RestUtils.buildGetBlobOptions(args, subResource, GetOption.None, null, NO_BLOB_SEGMENT_IDX_SPECIFIED);
      assertEquals("Unexpected range for args=" + args + " and subResource=" + subResource, expectedRange,
          options.getRange());
      assertEquals("Unexpected operation type for args=" + args + " and subResource=" + subResource, expectedOpType,
          options.getOperationType());
      assertEquals("Unexpected get options type for args=" + args + " and subResource=" + subResource, GetOption.None,
          options.getGetOption());
      assertEquals("Unexpected resolveRangeOnEmptyBlob for args=" + args + " and subResource=" + subResource,
          expectedResolveRangeOnEmptyBlob, options.resolveRangeOnEmptyBlob());
    } else {
      try {
        RestUtils.buildGetBlobOptions(args, subResource, GetOption.None, null, NO_BLOB_SEGMENT_IDX_SPECIFIED);
        fail("buildGetBlobOptions should not have succeeded with args=" + args + "and subResource=" + subResource);
      } catch (RestServiceException expected) {
        assertEquals("Unexpected error code.", RestServiceErrorCode.InvalidArgs, expected.getErrorCode());
      }
    }
  }
Test that {@link RestUtils#buildGetBlobOptions(Map, RestUtils.SubResource, GetOption, int)} works correctly with given args and a
specified sub-resource.
@param args the map of args for the method call.
@param subResource the sub-resource for the call.
@param expectedRange the {@link ByteRange} expected to be parsed if the call should succeed, or {@code null} if no
                     range is expected.
@param expectedOpType the {@link OperationType} expected to be set in the {@link GetBlobOptions}
                      object.
@param expectedResolveRangeOnEmptyBlob the expected value of {@link GetBlobOptions#resolveRangeOnEmptyBlob}.
@param shouldSucceed {@code true} if the call should succeed.
@throws RestServiceException
ambry-api/src/test/java/com/github/ambry/rest/RestUtilsTest.java