@Test
    void requireThatChangingTargetTypeOfReferenceFieldIsNotOK() {
        var validator = new DocumentTypeChangeValidator(ClusterSpec.Id.from("test"),
                createDocumentTypeWithReferenceField("oldDoc"),
                createDocumentTypeWithReferenceField("newDoc"));
        List<VespaConfigChangeAction> result = validator.validate();
        assertEquals(1, result.size());
        VespaConfigChangeAction action = result.get(0);
        assertTrue(action instanceof VespaRefeedAction);
        assertEquals(
                "type='refeed', " +
                        "message='Field 'ref' changed: data type: 'Reference<oldDoc>' -> 'Reference<newDoc>'', " +
                        "services=[], documentType=''",
                action.toString());
    }
Test validation of changes between a current and next document type used in a document database.

@author toregge
config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java