public void resolveReferences(SDDocumentType documentType) {
        var references = new DocumentReferences(createFieldToDocumentReferenceMapping(documentType));
        documentType.setDocumentReferences(references);
    }
@Test
    void throws_exception_if_reference_is_not_an_attribute() {
        Throwable exception = assertThrows(IllegalArgumentException.class, () -> {
            // Create bar document with no fields
            Schema barSchema = new Schema(BAR, MockApplicationPackage.createEmpty());
            SDDocumentType barDocument = new SDDocumentType("bar", barSchema);
            barSchema.addDocument(barDocument);

            // Create foo document with document reference to bar
            Schema fooSchema = new Schema(FOO, MockApplicationPackage.createEmpty());
            SDDocumentType fooDocument = new SDDocumentType("foo", fooSchema);
            SDField fooRefToBarField = new SDField
                    (fooDocument, "bar_ref", new NewDocumentReferenceDataType(barDocument.getDocumentType()));
            fooDocument.addField(fooRefToBarField);
            fooSchema.addDocument(fooDocument);

            DocumentReferenceResolver resolver = new DocumentReferenceResolver(List.of(fooSchema, barSchema));
            resolver.resolveReferences(fooDocument);
        });
        assertTrue(exception.getMessage().contains("The field 'bar_ref' is an invalid document reference. The field must be an attribute."));
    }