All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.deephacks.tools4j.config.test.integration.IntegrationTestsBuilder Maven / Gradle / Ivy

The newest version!
package org.deephacks.tools4j.config.test.integration;

import org.deephacks.tools4j.config.spi.BeanManager;
import org.deephacks.tools4j.config.spi.SchemaManager;
import org.deephacks.tools4j.config.test.FeatureTestsBuilder;

import java.util.ArrayList;
import java.util.List;

/**
 * IntegrationTestSuiteBuilder assume impl of ConfigContext and AdminContext
 * to be available on classpath during 'test' phase.
 */
public class IntegrationTestsBuilder extends FeatureTestsBuilder {
    private ArrayList> tests = new ArrayList<>();

    public static IntegrationTestsBuilder named(String name) {
        IntegrationTestsBuilder builder = new IntegrationTestsBuilder();
        builder.name = name;
        return builder;
    }

    public IntegrationTestsBuilder using(BeanManager manager) {
        using(BeanManager.class, manager);
        return this;
    }

    public IntegrationTestsBuilder using(SchemaManager manager) {
        using(SchemaManager.class, manager);
        return this;
    }

    public IntegrationTestsBuilder addTest(Class cls) {
        tests.add(cls);
        return this;
    }

    @Override
    protected List> getTests() {
        if( tests != null && !tests.isEmpty()) {
            return tests;
        }
        ArrayList> tests = new ArrayList<>();
        tests.add(IntegrationConfigTests.class);
        withSetUp(new IntegrationConfigTests());
        tests.add(IntegrationValidationTests.class);
        withSetUp(new IntegrationValidationTests());
        return tests;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy