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

com.github.dreamhead.moco.parser.model.BaseActionSetting Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
package com.github.dreamhead.moco.parser.model;

import com.github.dreamhead.moco.HttpHeader;

import java.util.Map;

import static com.github.dreamhead.moco.Moco.header;

public abstract class BaseActionSetting {
    protected final HttpHeader[] asHeaders(final Map headers) {
        if (headers == null) {
            return new HttpHeader[0];
        }

        return headers.entrySet().stream()
                .map(input -> header(input.getKey(), input.getValue().asResource()))
                .toArray(HttpHeader[]::new);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy