public void path_annotation_present()
{
SymbolSource symbolSource = mockSymbolSource();
AssetSource assetSource = mockAssetSource();
ObjectLocator locator = mockObjectLocator();
ClassTransformation ct = mockClassTransformation();
MutableComponentModel model = mockMutableComponentModel();
Path annotation = mockPath();
String fieldName = "myField";
String fieldType = "java.lang.Object";
String value = "${foo}";
String expanded = "foo.gif";
train_getFieldAnnotation(ct, fieldName, Path.class, annotation);
train_value(annotation, value);
train_expandSymbols(symbolSource, value, expanded);
train_addInjectedField(ct, AssetSource.class, "assetSource", assetSource, "as");
train_getResourcesFieldName(ct, "rez");
// This only tests that the code is generated as expected (which is a bit brittle), it
// doesn't prove that the generated code actually works, but we have lots of integration
// tests for that.
ct
.extendConstructor("myField = (java.lang.Object) as.findAsset(rez.getBaseResource(), \"foo.gif\", rez.getLocale());");
ct.makeReadOnly(fieldName);
replay();
InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);