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