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

org.arquillian.ape.rest.postman.PostmanPopulatorService Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha.7
Show newest version
package org.arquillian.ape.rest.postman;

import java.util.List;
import java.util.Map;
import org.arquillian.ape.rest.RestPopulatorService;
import org.arquillian.ape.rest.postman.runner.HostPortOverride;
import org.arquillian.ape.rest.postman.runner.PostmanRunner;

class PostmanPopulatorService implements RestPopulatorService {

    @Override
    public Class getPopulatorAnnotation() {
        return Postman.class;
    }

    @Override
    public void execute(List resources, Map variables) {
        executeScripts(resources, variables);
    }

    @Override
    public void execute(String host, int bindPort, List resources, Map variables) {
        executeScripts(host, bindPort, resources, variables);
    }

    @Override
    public void clean(List resources, Map variables) {
        executeScripts(resources, variables);
    }

    @Override
    public void clean(String host, int bindPort, List resources, Map variables) {
        executeScripts(host, bindPort, resources, variables);
    }

    private void executeScripts(String host, int bindPort, List resources, Map variables) {
        PostmanRunner postmanRunner = new PostmanRunner();
        postmanRunner.executeCalls(new HostPortOverride(host, bindPort), variables,
            resources.toArray(new String[resources.size()]));
    }

    private void executeScripts(List resources, Map variables) {
        PostmanRunner postmanRunner = new PostmanRunner();
        postmanRunner.executeCalls(variables, resources.toArray(new String[resources.size()]));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy