// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Headers {
// 	static final String CONTENT_TYPE = Parameters.CONTENT_TYPE, ACCEPT = Parameters.ACCEPT, BASE_URI = Parameters.BASE_URI;
// }
// 
// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Methods {
// 	static final String PUT = "PUT", POST = "POST", DELETE = "DELETE", GET = "GET";
// }
// 
// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Parameters {
// 
// 	static final String URI = "uri",
// 			S = "s",
// 			P = "p",
// 			O = "o",
// 			C = "c",
// 			S2 = "s2",
// 			P2 = "p2",
// 			O2 = "o2",
// 			C2 = "c2",
// 			ACCEPT = "accept",
// 			QUERY = "query",
// 			UPDATE = "update",
// 			BASE_URI = "base-uri",
// 			CONTENT_TYPE = "content-type";
// }


import static edu.kit.aifb.cumulus.WebTestUtils.SELECT_ALL_TRIPLES_PATTERN;
import static edu.kit.aifb.cumulus.WebTestUtils.clean;
import static edu.kit.aifb.cumulus.WebTestUtils.newTripleStore;
import static edu.kit.aifb.cumulus.WebTestUtils.numOfRes;
import static edu.kit.aifb.cumulus.util.Util.parseNX;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.openrdf.model.Statement;
import org.openrdf.model.Value;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.rio.ntriples.NTriplesUtil;
import edu.kit.aifb.cumulus.AbstractCumulusWebTest;
import edu.kit.aifb.cumulus.framework.Environment.ConfigParams;
import edu.kit.aifb.cumulus.framework.Environment.ConfigValues;
import edu.kit.aifb.cumulus.store.sesame.CumulusRDFSail;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Headers;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Methods;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Parameters;
	 * @param p the predicate.
	 * @param o the object.
	 * @param c the context.
	 * @return a mock {@link HttpServletRequest}.
	 */
	protected HttpServletRequest createMockHttpRequest(final Value uri, final Value s, final Value p, final Value o, final Value c) {
		return createMockHttpRequest(uri, s, p, o, c, null);
	}

	/**
	 * Creates a mock {@link HttpServletRequest} with given params.
	 * 
	 * @param uri the entity URI (used for describe).
	 * @param s the subject.
	 * @param p the predicate.
	 * @param o the object.
	 * @param c the context.
	 * @param MIME type in accept header.
	 * @return a mock {@link HttpServletRequest}.
	 */
	protected HttpServletRequest createMockHttpRequest(final Value uri, final Value s, final Value p, final Value o, final Value c, String accept_header) {

		final HttpServletRequest request = mock(HttpServletRequest.class);

		when(request.getParameter(Parameters.URI)).thenReturn(uri == null ? null : NTriplesUtil.toNTriplesString(uri));
		when(request.getParameter(Parameters.S)).thenReturn(s == null ? null : NTriplesUtil.toNTriplesString(s));
		when(request.getParameter(Parameters.P)).thenReturn(p == null ? null : NTriplesUtil.toNTriplesString(p));
		when(request.getParameter(Parameters.O)).thenReturn(o == null ? null : NTriplesUtil.toNTriplesString(o));
		when(request.getParameter(Parameters.C)).thenReturn(c == null ? null : NTriplesUtil.toNTriplesString(c));
		when(request.getRequestDispatcher(anyString())).thenReturn(mock(RequestDispatcher.class));
// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Headers {
// 	static final String CONTENT_TYPE = Parameters.CONTENT_TYPE, ACCEPT = Parameters.ACCEPT, BASE_URI = Parameters.BASE_URI;
// }
// 
// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Methods {
// 	static final String PUT = "PUT", POST = "POST", DELETE = "DELETE", GET = "GET";
// }
// 
// Path: cumulusrdf-web-module/src/main/java/edu/kit/aifb/cumulus/webapp/HttpProtocol.java
// public interface Parameters {
// 
// 	static final String URI = "uri",
// 			S = "s",
// 			P = "p",
// 			O = "o",
// 			C = "c",
// 			S2 = "s2",
// 			P2 = "p2",
// 			O2 = "o2",
// 			C2 = "c2",
// 			ACCEPT = "accept",
// 			QUERY = "query",
// 			UPDATE = "update",
// 			BASE_URI = "base-uri",
// 			CONTENT_TYPE = "content-type";
// }


// Path: cumulusrdf-web-module/src/test/java/edu/kit/aifb/cumulus/webapp/AbstractCRUDServletTest.java
import static edu.kit.aifb.cumulus.WebTestUtils.SELECT_ALL_TRIPLES_PATTERN;
import static edu.kit.aifb.cumulus.WebTestUtils.clean;
import static edu.kit.aifb.cumulus.WebTestUtils.newTripleStore;
import static edu.kit.aifb.cumulus.WebTestUtils.numOfRes;
import static edu.kit.aifb.cumulus.util.Util.parseNX;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.openrdf.model.Statement;
import org.openrdf.model.Value;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.rio.ntriples.NTriplesUtil;
import edu.kit.aifb.cumulus.AbstractCumulusWebTest;
import edu.kit.aifb.cumulus.framework.Environment.ConfigParams;
import edu.kit.aifb.cumulus.framework.Environment.ConfigValues;
import edu.kit.aifb.cumulus.store.sesame.CumulusRDFSail;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Headers;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Methods;
import edu.kit.aifb.cumulus.webapp.HttpProtocol.Parameters;

	 * @param p the predicate.
	 * @param o the object.
	 * @param c the context.
	 * @return a mock {@link HttpServletRequest}.
	 */
	protected HttpServletRequest createMockHttpRequest(final Value uri, final Value s, final Value p, final Value o, final Value c) {
		return createMockHttpRequest(uri, s, p, o, c, null);
	}

	/**
	 * Creates a mock {@link HttpServletRequest} with given params.
	 * 
	 * @param uri the entity URI (used for describe).
	 * @param s the subject.
	 * @param p the predicate.
	 * @param o the object.
	 * @param c the context.
	 * @param MIME type in accept header.
	 * @return a mock {@link HttpServletRequest}.
	 */
	protected HttpServletRequest createMockHttpRequest(final Value uri, final Value s, final Value p, final Value o, final Value c, String accept_header) {

		final HttpServletRequest request = mock(HttpServletRequest.class);

		when(request.getParameter(Parameters.URI)).thenReturn(uri == null ? null : NTriplesUtil.toNTriplesString(uri));
		when(request.getParameter(Parameters.S)).thenReturn(s == null ? null : NTriplesUtil.toNTriplesString(s));
		when(request.getParameter(Parameters.P)).thenReturn(p == null ? null : NTriplesUtil.toNTriplesString(p));
		when(request.getParameter(Parameters.O)).thenReturn(o == null ? null : NTriplesUtil.toNTriplesString(o));
		when(request.getParameter(Parameters.C)).thenReturn(c == null ? null : NTriplesUtil.toNTriplesString(c));
		when(request.getRequestDispatcher(anyString())).thenReturn(mock(RequestDispatcher.class));
		when(request.getMethod()).thenReturn(Methods.POST);