org.arquillian.ape.rest.postman.PostmanPopulatorService Maven / Gradle / Ivy
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