use of com.tvd12.ezyfox.bean.EzyPropertyFetcher in project ezyhttp by youngmonkeys.
the class ResourceResolversTest method testWithNullPattern.
@Test
public void testWithNullPattern() {
// given
EzyPropertyFetcher propertyFetcher = mock(EzyPropertyFetcher.class);
when(propertyFetcher.getProperty(RESOURCE_ENABLE, boolean.class, false)).thenReturn(true);
when(propertyFetcher.getProperty(RESOURCE_LOCATIONS, String[].class)).thenReturn(new String[] { "static" });
// when
ResourceResolver resourceResolver = ResourceResolvers.createResourdeResolver(propertyFetcher);
// then
assert resourceResolver != null;
Asserts.assertEquals(4, resourceResolver.getResources().size());
}
use of com.tvd12.ezyfox.bean.EzyPropertyFetcher in project ezyhttp by youngmonkeys.
the class ResourceResolversTest method test.
@Test
public void test() {
// given
EzyPropertyFetcher propertyFetcher = mock(EzyPropertyFetcher.class);
when(propertyFetcher.getProperty(RESOURCE_ENABLE, boolean.class, false)).thenReturn(true);
when(propertyFetcher.getProperty(RESOURCE_LOCATIONS, String[].class)).thenReturn(new String[] { "static" });
when(propertyFetcher.getProperty(RESOURCE_PATTERN, String.class)).thenReturn("static/.+");
// when
ResourceResolver resourceResolver = ResourceResolvers.createResourdeResolver(propertyFetcher);
// then
assert resourceResolver != null;
Asserts.assertEquals(4, resourceResolver.getResources().size());
}
Aggregations