use of jakarta.validation.MessageInterpolator.Context in project hibernate-validator by hibernate.
the class MessageInterpolatorContextTest method testGetPropertyPath.
@Test
@TestForIssue(jiraKey = "HV-1657")
public void testGetPropertyPath() {
Path pathMock = createMock(Path.class);
MessageInterpolator.Context context = new MessageInterpolatorContext(null, null, null, pathMock, Collections.<String, Object>emptyMap(), Collections.<String, Object>emptyMap(), ExpressionLanguageFeatureLevel.BEAN_METHODS, false);
assertSame(context.unwrap(HibernateMessageInterpolatorContext.class).getPropertyPath(), pathMock);
}
use of jakarta.validation.MessageInterpolator.Context in project hibernate-validator by hibernate.
the class MessageInterpolatorContextTest method testUnwrapToInterfaceTypesSucceeds.
@Test
public void testUnwrapToInterfaceTypesSucceeds() {
Context context = new MessageInterpolatorContext(null, null, null, null, Collections.<String, Object>emptyMap(), Collections.<String, Object>emptyMap(), ExpressionLanguageFeatureLevel.BEAN_METHODS, false);
MessageInterpolator.Context asMessageInterpolatorContext = context.unwrap(MessageInterpolator.Context.class);
assertSame(asMessageInterpolatorContext, context);
HibernateMessageInterpolatorContext asHibernateMessageInterpolatorContext = context.unwrap(HibernateMessageInterpolatorContext.class);
assertSame(asHibernateMessageInterpolatorContext, context);
Object asObject = context.unwrap(Object.class);
assertSame(asObject, context);
}
use of jakarta.validation.MessageInterpolator.Context in project hibernate-validator by hibernate.
the class MessageInterpolatorContextTest method testUnwrapToImplementationCausesValidationException.
@Test(expectedExceptions = ValidationException.class)
public void testUnwrapToImplementationCausesValidationException() {
Context context = new MessageInterpolatorContext(null, null, null, null, Collections.<String, Object>emptyMap(), Collections.<String, Object>emptyMap(), ExpressionLanguageFeatureLevel.BEAN_METHODS, false);
context.unwrap(MessageInterpolatorContext.class);
}
use of jakarta.validation.MessageInterpolator.Context in project hibernate-validator by hibernate.
the class MessageInterpolatorContextTest method testGetRootBeanType.
@Test
public void testGetRootBeanType() {
Class<Object> rootBeanType = Object.class;
MessageInterpolator.Context context = new MessageInterpolatorContext(null, null, rootBeanType, null, Collections.<String, Object>emptyMap(), Collections.<String, Object>emptyMap(), ExpressionLanguageFeatureLevel.BEAN_METHODS, false);
assertSame(context.unwrap(HibernateMessageInterpolatorContext.class).getRootBeanType(), rootBeanType);
}
Aggregations