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

com.github.dreamhead.moco.model.Session 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.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.github.dreamhead.moco.HttpRequest;
import com.github.dreamhead.moco.HttpResponse;

public class Session {
    @JsonDeserialize(as = DefaultHttpRequest.class)
    private HttpRequest request;
    @JsonDeserialize(as = DefaultHttpResponse.class)
    private HttpResponse response;

    public HttpRequest getRequest() {
        return request;
    }

    public HttpResponse getResponse() {
        return response;
    }

    @JsonCreator
    public static Session newSession(@JsonProperty("request") final HttpRequest request,
                                     @JsonProperty("response") final HttpResponse response) {
        Session session = new Session();
        session.request = request;
        session.response = response;
        return session;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy