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

com.github.dreamhead.moco.handler.StatusCodeResponseHandler 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.handler;

import com.github.dreamhead.moco.HttpRequest;
import com.github.dreamhead.moco.MutableHttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;

public class StatusCodeResponseHandler extends AbstractHttpResponseHandler {
    private final HttpResponseStatus status;

    public StatusCodeResponseHandler(final int code) {
        status = HttpResponseStatus.valueOf(code);
    }

    @Override
    protected void doWriteToResponse(final HttpRequest httpRequest, final MutableHttpResponse httpResponse) {
        httpResponse.setStatus(status.code());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy