@Test public void 意図したサフィックスが付与されたArgumentsが生成される() { Object[] args = validator.getArgumentsForConstraint("profile", "name", descriptor); assertThat(args, is(notNullValue())); assertThat(args.length, is(1)); assertThat(args[0], is(instanceOf(DefaultMessageSourceResolvable.class))); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes().length, is(4)); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[0], is("profile.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[1], is("profileCriteria.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[2], is("profileSelection.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[3], is("name")); args = validator.getArgumentsForConstraint("profileCriteria", "name", descriptor); assertThat(args, is(notNullValue())); assertThat(args.length, is(1)); assertThat(args[0], is(instanceOf(DefaultMessageSourceResolvable.class))); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes().length, is(4)); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[0], is("profileCriteria.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[1], is("profile.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[2], is("profileSelection.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[3], is("name")); args = validator.getArgumentsForConstraint("profileSelection", "name", descriptor); assertThat(args, is(notNullValue())); assertThat(args.length, is(1)); assertThat(args[0], is(instanceOf(DefaultMessageSourceResolvable.class))); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes().length, is(4)); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[0], is("profileSelection.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[1], is("profile.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[2], is("profileCriteria.name")); assertThat(((DefaultMessageSourceResolvable)args[0]).getCodes()[3], is("name")); }
@Override protected Object[] getArgumentsForConstraint(final String objectName, String field, ConstraintDescriptor<?> descriptor) { Object[] args = super.getArgumentsForConstraint(objectName, field, descriptor); int index = 0; for (Object arg : args) { if (arg instanceof DefaultMessageSourceResolvable) { args[index] = getMessageSourceResolvable(objectName, field); } index++; } return args; }
JseLocalValidatorFactoryBean extends LocalValidatorFactoryBean { @Override protected Object[] getArgumentsForConstraint(final String objectName, String field, ConstraintDescriptor<?> descriptor) { Object[] args = super.getArgumentsForConstraint(objectName, field, descriptor); int index = 0; for (Object arg : args) { if (arg instanceof DefaultMessageSourceResolvable) { args[index] = getMessageSourceResolvable(objectName, field); } index++; } return args; } }
JseLocalValidatorFactoryBean extends LocalValidatorFactoryBean { @Override protected Object[] getArgumentsForConstraint(final String objectName, String field, ConstraintDescriptor<?> descriptor) { Object[] args = super.getArgumentsForConstraint(objectName, field, descriptor); int index = 0; for (Object arg : args) { if (arg instanceof DefaultMessageSourceResolvable) { args[index] = getMessageSourceResolvable(objectName, field); } index++; } return args; }  }
JseLocalValidatorFactoryBean extends LocalValidatorFactoryBean { @Override protected Object[] getArgumentsForConstraint(final String objectName, String field, ConstraintDescriptor<?> descriptor) { Object[] args = super.getArgumentsForConstraint(objectName, field, descriptor); int index = 0; for (Object arg : args) { if (arg instanceof DefaultMessageSourceResolvable) { args[index] = getMessageSourceResolvable(objectName, field); } index++; } return args; }   }
JseLocalValidatorFactoryBean extends LocalValidatorFactoryBean { @Override protected Object[] getArgumentsForConstraint(final String objectName, String field, ConstraintDescriptor<?> descriptor) { Object[] args = super.getArgumentsForConstraint(objectName, field, descriptor); int index = 0; for (Object arg : args) { if (arg instanceof DefaultMessageSourceResolvable) { args[index] = getMessageSourceResolvable(objectName, field); } index++; } return args; }    }