// Path: here-oauth-client/src/main/java/com/here/account/http/HttpProvider.java
// public static interface HttpRequest {
//         
//     /**
//      * Add the Authorization header to this request, with the specified 
//      * <tt>value</tt>.
//      * See also 
//      * <a href="https://tools.ietf.org/html/rfc7235#section-4.2">RFC 7235</a>.
//      * 
//      * @param value the value to add in the Authorization header
//      */
//     void addAuthorizationHeader(String value);
// 
//     /**
//      * Adds the additional (name, value)-pair to be sent as HTTP Headers
//      * on the HTTP Request.
//      * See also
//      * <a href="https://tools.ietf.org/html/rfc7230#section-3.2">RFC 7230</a>.
//      *
//      * @param name the name of the HTTP Header to add
//      * @param value the value of the HTTP Header to add
//      */
//     default void addHeader(String name, String value) {
//         throw new UnsupportedOperationException("addHeader not supported");
//     }
// 
// }
// 
// Path: here-oauth-client/src/main/java/com/here/account/util/Clock.java
// public interface Clock {
//     
//     /**
//      * java.lang.System Clock (digital approximation of wall clock).
//      */
//     Clock SYSTEM = new Clock() {
//         
//         /**
//          * {@inheritDoc}
//          */
//         @Override
//         public long currentTimeMillis() {
//             return System.currentTimeMillis();
//         }
//         
//         /**
//          * {@inheritDoc}
//          */
//         @Override
//         public void schedule(ScheduledExecutorService scheduledExecutorService, 
//                 Runnable runnable,
//                 long millisecondsInTheFutureToSchedule
//                 ) {
//             scheduledExecutorService.schedule(
//                     runnable,
//                     millisecondsInTheFutureToSchedule,
//                     TimeUnit.MILLISECONDS
//                 );
// 
//         }
//     };
// 
//     /**
//      * Returns the milliseconds UTC since the epoch.
//      * 
//      * @return this clock's currentTimeMillis in UTC since the epoch.
//      */
//     long currentTimeMillis();
// 
//     /**
//      * Schedules <tt>runnable</tt> the specified <tt>millisecondsInTheFutureToSchedule</tt>
//      * using <tt>scheduledExecutorService</tt>.
//      * 
//      * @param scheduledExecutorService the ScheduledExecutorService to submit the runnable to
//      * @param runnable the runnable to execute on a schedule
//      * @param millisecondsInTheFutureToSchedule the schedule of milliseconds in the future, 
//      *      approximating when the runnable should run.
//      */
//     void schedule(ScheduledExecutorService scheduledExecutorService, 
//             Runnable runnable,
//             long millisecondsInTheFutureToSchedule
//             );
// }
// 
// Path: here-oauth-client/src/main/java/com/here/account/util/OAuthConstants.java
// public class OAuthConstants {
//     
//     /**
//      * We commonly use "UTF-8" charset, this String is its name.
//      */
//     public static final String UTF_8_STRING = "UTF-8";
//     
//     /**
//      * This is the constant for the "UTF-8" Charset already loaded.
//      */
//     public static final Charset UTF_8_CHARSET = Charset.forName(UTF_8_STRING);
// }


import org.junit.Before;
import org.junit.Test;
import com.here.account.http.HttpProvider.HttpRequest;
import com.here.account.util.Clock;
import com.here.account.util.OAuthConstants;
import static org.junit.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/*
 * Copyright (c) 2016 HERE Europe B.V.
 * 
 * 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 com.here.account.auth;






public class OAuth1SignerTest {

    private String accessKeyId = "access-key-id";
    private String accessKeySecret = "access-key-secret";
    
    private OAuth1Signer oauth1Signer;
    
    MyHttpRequest httpRequest;
    
// Path: here-oauth-client/src/main/java/com/here/account/http/HttpProvider.java
// public static interface HttpRequest {
//         
//     /**
//      * Add the Authorization header to this request, with the specified 
//      * <tt>value</tt>.
//      * See also 
//      * <a href="https://tools.ietf.org/html/rfc7235#section-4.2">RFC 7235</a>.
//      * 
//      * @param value the value to add in the Authorization header
//      */
//     void addAuthorizationHeader(String value);
// 
//     /**
//      * Adds the additional (name, value)-pair to be sent as HTTP Headers
//      * on the HTTP Request.
//      * See also
//      * <a href="https://tools.ietf.org/html/rfc7230#section-3.2">RFC 7230</a>.
//      *
//      * @param name the name of the HTTP Header to add
//      * @param value the value of the HTTP Header to add
//      */
//     default void addHeader(String name, String value) {
//         throw new UnsupportedOperationException("addHeader not supported");
//     }
// 
// }
// 
// Path: here-oauth-client/src/main/java/com/here/account/util/Clock.java
// public interface Clock {
//     
//     /**
//      * java.lang.System Clock (digital approximation of wall clock).
//      */
//     Clock SYSTEM = new Clock() {
//         
//         /**
//          * {@inheritDoc}
//          */
//         @Override
//         public long currentTimeMillis() {
//             return System.currentTimeMillis();
//         }
//         
//         /**
//          * {@inheritDoc}
//          */
//         @Override
//         public void schedule(ScheduledExecutorService scheduledExecutorService, 
//                 Runnable runnable,
//                 long millisecondsInTheFutureToSchedule
//                 ) {
//             scheduledExecutorService.schedule(
//                     runnable,
//                     millisecondsInTheFutureToSchedule,
//                     TimeUnit.MILLISECONDS
//                 );
// 
//         }
//     };
// 
//     /**
//      * Returns the milliseconds UTC since the epoch.
//      * 
//      * @return this clock's currentTimeMillis in UTC since the epoch.
//      */
//     long currentTimeMillis();
// 
//     /**
//      * Schedules <tt>runnable</tt> the specified <tt>millisecondsInTheFutureToSchedule</tt>
//      * using <tt>scheduledExecutorService</tt>.
//      * 
//      * @param scheduledExecutorService the ScheduledExecutorService to submit the runnable to
//      * @param runnable the runnable to execute on a schedule
//      * @param millisecondsInTheFutureToSchedule the schedule of milliseconds in the future, 
//      *      approximating when the runnable should run.
//      */
//     void schedule(ScheduledExecutorService scheduledExecutorService, 
//             Runnable runnable,
//             long millisecondsInTheFutureToSchedule
//             );
// }
// 
// Path: here-oauth-client/src/main/java/com/here/account/util/OAuthConstants.java
// public class OAuthConstants {
//     
//     /**
//      * We commonly use "UTF-8" charset, this String is its name.
//      */
//     public static final String UTF_8_STRING = "UTF-8";
//     
//     /**
//      * This is the constant for the "UTF-8" Charset already loaded.
//      */
//     public static final Charset UTF_8_CHARSET = Charset.forName(UTF_8_STRING);
// }


// Path: here-oauth-client/src/test/java/com/here/account/auth/OAuth1SignerTest.java
import org.junit.Before;
import org.junit.Test;
import com.here.account.http.HttpProvider.HttpRequest;
import com.here.account.util.Clock;
import com.here.account.util.OAuthConstants;
import static org.junit.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

/*
 * Copyright (c) 2016 HERE Europe B.V.
 * 
 * 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 com.here.account.auth;






public class OAuth1SignerTest {

    private String accessKeyId = "access-key-id";
    private String accessKeySecret = "access-key-secret";
    
    private OAuth1Signer oauth1Signer;
    
    MyHttpRequest httpRequest;
    
    private static class MyHttpRequest implements HttpRequest {