@Test
public void testCustomResourceRequestedUnitIsGreaterThanAvailableUnit()
        throws InvalidResourceRequestException {

  Resource requestedResource =
          ResourceTypesTestHelper.newResource(1, 1,
                  ImmutableMap.of("custom-resource-1", "1M"));
  Resource availableResource = ResourceTypesTestHelper.newResource(1, 1,
          ImmutableMap.<String, String>builder().put("custom-resource-1",
                  "120k")
                  .build());
  exception.expect(InvalidResourceRequestException.class);
  exception.expectMessage(InvalidResourceRequestExceptionMessageGenerator
          .create().withRequestedResourceType("custom-resource-1")
          .withRequestedResource(requestedResource)
          .withAvailableAllocation(availableResource)
          .withMaxAllocation(configuredMaxAllocation)
          .withInvalidResourceType(GREATER_THEN_MAX_ALLOCATION)
          .build());
  SchedulerUtils.checkResourceRequestAgainstAvailableResource(
          requestedResource, availableResource);
}