@Test
public void testAssertValidFactValue() {

  FactTypeEntity factType = new FactTypeEntity().setValidator("SomeValidator").setValidatorParameter("SomeParam");
  Validator validator = mock(Validator.class);
  when(validator.validate(eq("test"))).thenReturn(false);
  when(validatorFactory.get(factType.getValidator(), factType.getValidatorParameter())).thenReturn(validator);
  InvalidArgumentException ex = assertThrows(InvalidArgumentException.class,
          () -> handler.assertValidFactValue(factType, "test"));
  assertEquals(SetUtils.set("fact.not.valid"), SetUtils.set(ex.getValidationErrors(), InvalidArgumentException.ValidationError::getMessageTemplate));
}