Search in sources :

Example 6 with ValidationTester

use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.

the class ContentClusterRemovalValidatorTest method testContentRemovalValidation.

@Test
public void testContentRemovalValidation() throws IOException, SAXException {
    ValidationTester tester = new ValidationTester();
    VespaModel previous = tester.deploy(null, getServices("contentClusterId"), null).getFirst();
    try {
        tester.deploy(previous, getServices("newContentClusterId"), null);
        fail("Expected exception due to content cluster id change");
    } catch (IllegalArgumentException expected) {
        assertEquals("content-cluster-removal: Content cluster 'contentClusterId' is removed. This will cause loss of all data in this cluster", Exceptions.toMessageString(expected));
    }
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) ValidationTester(com.yahoo.vespa.model.application.validation.ValidationTester) Test(org.junit.Test)

Aggregations

VespaModel (com.yahoo.vespa.model.VespaModel)6 ValidationTester (com.yahoo.vespa.model.application.validation.ValidationTester)6 Test (org.junit.Test)6 ConfigChangeAction (com.yahoo.config.model.api.ConfigChangeAction)1