@Test public void no_path_annotation() { AssetSource source = mockAssetSource(); ObjectLocator locator = mockObjectLocator(); AnnotationProvider annotationProvider = mockAnnotationProvider(); TypeCoercer typeCoercer = mockTypeCoercer(); SymbolSource symbolSource = mockSymbolSource(); train_getAnnotation(annotationProvider, Path.class, null); replay(); ObjectProvider provider = new AssetObjectProvider(source, typeCoercer, symbolSource); assertNull(provider.provide(Asset.class, annotationProvider, locator)); verify(); }
public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { Path path = annotationProvider.getAnnotation(Path.class); if (path == null) return null; String expanded = symbolSource.expandSymbols(path.value()); Asset asset = source.getAsset(null, expanded, null); return typeCoercer.coerce(asset, objectType); }
AssetObjectProvider implements ObjectProvider { public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { Path path = annotationProvider.getAnnotation(Path.class); if (path == null) return null; String expanded = symbolSource.expandSymbols(path.value()); Asset asset = source.getAsset(null, expanded, null); return typeCoercer.coerce(asset, objectType); } }
AssetObjectProvider implements ObjectProvider { public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { Path path = annotationProvider.getAnnotation(Path.class); if (path == null) return null; String expanded = symbolSource.expandSymbols(path.value()); Asset asset = source.getAsset(null, expanded, null); return typeCoercer.coerce(asset, objectType); } AssetObjectProvider(@Core AssetSource source,

                               @Builtin TypeCoercer typeCoercer,

                               @Builtin SymbolSource symbolSource); }
AssetObjectProvider implements ObjectProvider { public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { Path path = annotationProvider.getAnnotation(Path.class); if (path == null) return null; String expanded = symbolSource.expandSymbols(path.value()); Asset asset = source.getAsset(null, expanded, null); return typeCoercer.coerce(asset, objectType); } AssetObjectProvider(@Core AssetSource source,

                               @Builtin TypeCoercer typeCoercer,

                               @Builtin SymbolSource symbolSource); T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator); }
AssetObjectProvider implements ObjectProvider { public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { Path path = annotationProvider.getAnnotation(Path.class); if (path == null) return null; String expanded = symbolSource.expandSymbols(path.value()); Asset asset = source.getAsset(null, expanded, null); return typeCoercer.coerce(asset, objectType); } AssetObjectProvider(@Core AssetSource source,

                               @Builtin TypeCoercer typeCoercer,

                               @Builtin SymbolSource symbolSource); T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator);  }