@Test public void testContextRemainsUnchanged() { final String context0 = "CONTEXT0"; final String context1 = "CONTEXT1"; final String context2 = "CONTEXT2"; final String newContext = "NEW_CONTEXT"; IValidationResult result = ValidationResult.create(); result = result.withError(context0, null); result = result.withError(context1, null); result = result.withError(context2, null); final List<IValidationMessage> errors = result.getErrors(); Assert.assertTrue(errors.get(0).getContext().equals(context0)); Assert.assertTrue(errors.get(1).getContext().equals(context1)); Assert.assertTrue(errors.get(2).getContext().equals(context2)); result = result.withContext(newContext); assertContext(result.getAll(), newContext); }
public static IValidationResult create() { return OK; }
ValidationResult { public static IValidationResult create() { return OK; } }
ValidationResult { public static IValidationResult create() { return OK; } private  ValidationResult(); }
ValidationResult { public static IValidationResult create() { return OK; } private  ValidationResult(); static IValidationResult create(); static IValidationResult ok(); static IValidationResult create(final IValidationMessage message); static IValidationResult info(final String text); static IValidationResult warning(final String text); static IValidationResult infoError(final String text); static IValidationResult error(final String text); static IValidationResult info(final String context, final String text); static IValidationResult warning(final String context, final String text); static IValidationResult infoError(final String context, final String text); static IValidationResult error(final String context, final String text); static IValidationResultBuilder builder(); }
ValidationResult { public static IValidationResult create() { return OK; } private  ValidationResult(); static IValidationResult create(); static IValidationResult ok(); static IValidationResult create(final IValidationMessage message); static IValidationResult info(final String text); static IValidationResult warning(final String text); static IValidationResult infoError(final String text); static IValidationResult error(final String text); static IValidationResult info(final String context, final String text); static IValidationResult warning(final String context, final String text); static IValidationResult infoError(final String context, final String text); static IValidationResult error(final String context, final String text); static IValidationResultBuilder builder();  }