Search in sources :

Example 1 with TypeLocator

use of org.springframework.expression.TypeLocator in project spring-security by spring-projects.

the class DelegatingEvaluationContextTests method getTypeLocator.

@Test
public void getTypeLocator() {
    TypeLocator expected = mock(TypeLocator.class);
    when(this.delegate.getTypeLocator()).thenReturn(expected);
    assertThat(this.context.getTypeLocator()).isEqualTo(expected);
}
Also used : TypeLocator(org.springframework.expression.TypeLocator) Test(org.junit.Test)

Example 2 with TypeLocator

use of org.springframework.expression.TypeLocator in project spring-framework by spring-projects.

the class StandardComponentsTests method testStandardEvaluationContext.

@Test
public void testStandardEvaluationContext() {
    StandardEvaluationContext context = new StandardEvaluationContext();
    assertNotNull(context.getTypeComparator());
    TypeComparator tc = new StandardTypeComparator();
    context.setTypeComparator(tc);
    assertEquals(tc, context.getTypeComparator());
    TypeLocator tl = new StandardTypeLocator();
    context.setTypeLocator(tl);
    assertEquals(tl, context.getTypeLocator());
}
Also used : TypeComparator(org.springframework.expression.TypeComparator) TypeLocator(org.springframework.expression.TypeLocator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 TypeLocator (org.springframework.expression.TypeLocator)2 TypeComparator (org.springframework.expression.TypeComparator)1