com.github.dreamhead.moco.parser.BaseParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-runner Show documentation
Show all versions of moco-runner Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.parser;
import com.github.dreamhead.moco.MocoConfig;
import com.github.dreamhead.moco.Server;
import com.github.dreamhead.moco.parser.model.SessionSetting;
import com.github.dreamhead.moco.util.Jsons;
import com.google.common.collect.ImmutableList;
import java.io.InputStream;
public abstract class BaseParser implements Parser {
protected abstract T createServer(ImmutableList read,
int port, MocoConfig... configs);
public final T parseServer(final ImmutableList streams,
final int port,
final MocoConfig... configs) {
ImmutableList settings = Jsons.toObjects(streams, SessionSetting.class);
return createServer(settings, port, configs);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy