/*
 * Copyright 2016 Marten Gajda <marten@dmfs.org>
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.dmfs.httpessentials.mockutils.requests;

import org.dmfs.httpessentials.HttpMethod;
import org.dmfs.httpessentials.client.HttpRequest;
import org.dmfs.httpessentials.client.HttpRequestEntity;
import org.dmfs.httpessentials.client.HttpResponse;
import org.dmfs.httpessentials.client.HttpResponseHandler;
import org.dmfs.httpessentials.exceptions.ProtocolError;
import org.dmfs.httpessentials.exceptions.ProtocolException;
import org.dmfs.httpessentials.headers.EmptyHeaders;
import org.dmfs.httpessentials.headers.Headers;

import java.io.IOException;


/**
 * An empty {@link HttpRequest} for testing.
 *
 * @author Gabor Keszthelyi
 */
public class EmptyRequest<T> implements HttpRequest<T>
{
    @Override
    public HttpMethod method()
    {
        return null;
    }


    @Override
    public Headers headers()
    {
        return EmptyHeaders.INSTANCE;
    }


    @Override
    public HttpRequestEntity requestEntity()
    {
        return null;
    }


    @Override
    public HttpResponseHandler<T> responseHandler(HttpResponse response) throws IOException, ProtocolError, ProtocolException
    {
        return null;
    }
}

@@ -1149,35 +1149,112 @@
 rs;%0A
-%0Aimport java.io.IOException
+import org.dmfs.httpessentials.types.MediaType;%0A%0Aimport java.io.IOException;%0Aimport java.io.OutputStream
 ;%0A%0A%0A
@@ -1449,35 +1449,65 @@
   %7B%0A        
-return null
+throw new UnsupportedOperationException()
 ;%0A    %7D%0A%0A%0A  
@@ -1672,35 +1672,59 @@
         return n
-ull
+ew EmptyHttpRequestEntity()
 ;%0A    %7D%0A%0A%0A    @O
@@ -1875,20 +1875,472 @@
     
-return null;
+throw new UnsupportedOperationException();%0A    %7D%0A%0A%0A    private final class EmptyHttpRequestEntity implements HttpRequestEntity%0A    %7B%0A%0A        @Override%0A        public MediaType contentType()%0A        %7B%0A            return null;%0A        %7D%0A%0A%0A        @Override%0A        public long contentLength() throws IOException%0A        %7B%0A            return -1;%0A        %7D%0A%0A%0A        @Override%0A        public void writeContent(OutputStream out) throws IOException%0A        %7B%0A        %7D%0A
 %0A   

Update EmptyRequest to either throw UnsupportedOperationsException or provide empty value for methods.