/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.amber.signature;

import java.net.URL;
import java.util.Collection;
import java.util.HashSet;

import org.apache.amber.HTTPMethod;
import org.apache.amber.OAuthMessageParameter;
import org.apache.amber.OAuthRequest;
import org.apache.amber.OAuthRequestParameter;

/**
 * 
 * @version $Id$
 */
final class FakeOAuthRequest implements OAuthRequest {

    private HTTPMethod httpMethod;

    private URL requestURL;

    private final Collection<OAuthMessageParameter> messageParameters = new HashSet<OAuthMessageParameter>();

    private final Collection<OAuthRequestParameter> requestParameters = new HashSet<OAuthRequestParameter>();

    public void addOAuthMessageParameter(OAuthMessageParameter parameter) {
        this.messageParameters.add(parameter);
    }

    public void addOAuthRequestParameter(OAuthRequestParameter parameter) {
        this.requestParameters.add(parameter);
    }

    public HTTPMethod getHTTPMethod() {
        return this.httpMethod;
    }

    public void setHTTPMethod(HTTPMethod httpMethod) {
        this.httpMethod = httpMethod;
    }

    public Collection<OAuthMessageParameter> getOAuthMessageParameters() {
        return this.messageParameters;
    }

    public Collection<OAuthRequestParameter> getOAuthRequestParameters() {
        return this.requestParameters;
    }

    public URL getRequestURL() {
        return this.requestURL;
    }

    public void setRequestURL(URL requestURL) {
        this.requestURL = requestURL;
    }

}

@@ -871,26 +871,25 @@
 va.util.
-Collection
+SortedSet
 ;%0Aimport
@@ -899,20 +899,20 @@
 va.util.
-Hash
+Tree
 Set;%0A%0Aim
@@ -992,16 +992,56 @@
 ameter;%0A
+import org.apache.amber.OAuthParameter;%0A
 import o
@@ -1282,34 +1282,33 @@
 ivate final 
-Collection
+SortedSet
 %3COAuthMessag
@@ -1335,36 +1335,36 @@
 arameters = new 
-Hash
+Tree
 Set%3COAuthMessage
@@ -1396,26 +1396,25 @@
 e final 
-Collection
+SortedSet
 %3COAuthRe
@@ -1457,12 +1457,13 @@
 new 
-Hash
+ Tree
 Set%3C
@@ -1935,34 +1935,33 @@
 %0A    public 
-Collection
+SortedSet
 %3COAuthMessag
@@ -2063,18 +2063,17 @@
 lic 
-Collection
+SortedSet
 %3COAu
@@ -2333,10 +2333,516 @@
 %0A    %7D%0A%0A
+%09public String getOAuthMessageParameter(OAuthParameter parameter) %7B%0A%09%09for (OAuthMessageParameter omp : this.messageParameters) %7B%0A%09%09%09if (omp.getKey().equals(parameter)) %7B%0A%09%09%09%09return omp.getValue();%0A%09%09%09%7D%0A%09%09%7D%09%09%0A%09%09return null; // not ideal, but it's only a test%0A%09%7D%0A%0A%09public String getOAuthRequestParameter(String name) %7B%0A%09%09for (OAuthRequestParameter orp : this.requestParameters) %7B%0A%09%09%09if (orp.getKey().equals(name)) %7B%0A%09%09%09%09return orp.getValue();%0A%09%09%09%7D%0A%09%09%7D%09%09%0A%09%09return null; // not ideal, but it's only a test%0A%09%7D%0A%0A
 %7D%0A

Fix test case (side effect of OAuthRequest modification)