@Test
  public void testValidationMessages() throws Exception {
    when(validator.validate(mockJobParameters)).thenReturn(ERROR_LIST);

    try {
      enforcer.ensureValid(mockJobParameters);

      fail("Expected ensureValid to fail");
    } catch (ValidationEnforcer.ValidationException ve) {
      assertEquals(
          "Expected ValidationException to have 1 error message", 1, ve.getErrors().size());
    }
  }
Tests for the {@link ValidationEnforcer} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/ValidationEnforcerTest.java