us.abstracta.jmeter.javadsl.bridge.serialization.constructs.HttpHeadersConstruct Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmeter-java-dsl-bridge Show documentation
Show all versions of jmeter-java-dsl-bridge Show documentation
Module which allows to build simple adapters for JMeter Java DSL in other languages
The newest version!
package us.abstracta.jmeter.javadsl.bridge.serialization.constructs;
import java.util.Map;
import org.yaml.snakeyaml.nodes.Node;
import org.yaml.snakeyaml.nodes.ScalarNode;
import us.abstracta.jmeter.javadsl.http.HttpHeaders;
public class HttpHeadersConstruct extends BaseBridgedObjectConstruct {
@Override
public Object construct(Node node) {
Map properties = getNodeProperties(node, "httpHeaders");
HttpHeaders ret = new HttpHeaders();
properties.forEach((key, value) -> ret.header(key, ((ScalarNode) value).getValue()));
return ret;
}
}