com.github.dreamhead.moco.handler.ProcedureResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.handler;
import com.github.dreamhead.moco.MocoProcedure;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.internal.SessionContext;
public class ProcedureResponseHandler extends AbstractResponseHandler implements ResponseHandler {
private final MocoProcedure procedure;
public ProcedureResponseHandler(final MocoProcedure procedure) {
this.procedure = procedure;
}
@Override
public void writeToResponse(final SessionContext context) {
this.procedure.execute();
}
}