Add helper function for adding attribute aspect to field
@@ -35,7 +35,7 @@ public class DocumentReferenceResolverTest {
// Create foo document with document reference to bar and add another field
SDField fooRefToBarField = new SDField
("bar_ref", ReferenceDataType.createWithInferredId(barDocument.getDocumentType()));
- fooRefToBarField.parseIndexingScript("{ attribute }");
+ addAttributeAspect(fooRefToBarField);
SDField irrelevantField = new SDField("irrelevant_stuff", DataType.INT);
Search fooSearch = new Search();
SDDocumentType fooDocument = new SDDocumentType("foo", fooSearch);
@@ -58,7 +58,7 @@ public class DocumentReferenceResolverTest {
// Create foo document with document reference to non-existing document bar
SDField fooRefToBarField = new SDField(
"bar_ref", ReferenceDataType.createWithInferredId(TemporaryStructuredDataType.create("bar")));
- fooRefToBarField.parseIndexingScript("{ attribute }");
+ addAttributeAspect(fooRefToBarField);
Search fooSearch = new Search();
SDDocumentType fooDocument = new SDDocumentType("foo", fooSearch);
fooDocument.addField(fooRefToBarField);
@@ -80,7 +80,7 @@ public class DocumentReferenceResolverTest {
SDDocumentType barDocument = new SDDocumentType("bar", barSearch);
barSearch.addDocument(barDocument);
- // Create foo document with document reference to bar and add another field
+ // Create foo document with document reference to bar
SDField fooRefToBarField = new SDField
("bar_ref", ReferenceDataType.createWithInferredId(barDocument.getDocumentType()));
Search fooSearch = new Search();
@@ -95,4 +95,8 @@ public class DocumentReferenceResolverTest {
resolver.resolveReferences(fooDocument);
}
+ private static void addAttributeAspect(SDField fooRefToBarField) {
+ fooRefToBarField.parseIndexingScript("{ attribute }");
+ }
+
}
