ResourcePathTypeResolver implements TypeResolver { @Override public <T> T resolve(String resourcePath, String property) { String type = resolveProperty(resourcePath, property); try { return (T) Class.forName(type).getDeclaredConstructor().newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { throw new CitrusRuntimeException(String.format("Failed to resolve classpath resource of type '%s'", type), e); } } ResourcePathTypeResolver();  ResourcePathTypeResolver(String resourceBasePath); @Override String resolveProperty(String resourcePath, String property); @Override T resolve(String resourcePath, String property); @Override Map<String, T> resolveAll(String resourcePath, String property, String keyProperty);  }
@Test public void testResolve() { Assert.assertEquals(new ResourcePathTypeResolver().resolve("mocks/foo").getClass(), Foo.class); Assert.assertEquals(new ResourcePathTypeResolver("META-INF/mocks").resolve("foo").getClass(), Foo.class); Assert.assertEquals(new ResourcePathTypeResolver("META-INF/mocks").resolve("bar").getClass(), Bar.class); Assert.assertEquals(new ResourcePathTypeResolver("META-INF/mocks").resolve("foo", TypeResolver.DEFAULT_TYPE_PROPERTY).getClass(), Foo.class); }