/**
 * Copyright 2011 Microsoft Corporation
 * 
 * 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.microsoft.windowsazure.services.serviceBus.implementation;

import static org.junit.Assert.*;

import java.net.URI;

import org.junit.Test;

import com.microsoft.windowsazure.services.core.Configuration;
import com.microsoft.windowsazure.services.serviceBus.ServiceBusConfiguration;
import com.sun.jersey.api.client.Client;

public class WrapRestProxyIntegrationTest {
    @Test
    public void serviceCanBeCalledToCreateAccessToken() throws Exception {
        // Arrange
        Configuration config = Configuration.getInstance();
        WrapContract contract = new WrapRestProxy(config.create(Client.class));

        // Act
        String uri = (String) config.getProperty(ServiceBusConfiguration.WRAP_URI);
        String name = (String) config.getProperty(ServiceBusConfiguration.WRAP_NAME);
        String password = (String) config.getProperty(ServiceBusConfiguration.WRAP_PASSWORD);
        String scope = new URI("http", new URI(uri).getAuthority(), new URI(uri).getPath(), null, null).toString();
        WrapAccessTokenResult result = contract.wrapAccessToken(uri, name, password, scope);

        // Assert
        assertNotNull(result);
        assertNotNull(result.getAccessToken());
    }
}

@@ -1245,16 +1245,105 @@
  // Act%0A
+        String serviceBusUri = (String) config.getProperty(ServiceBusConfiguration.URI);%0A
         
@@ -1641,25 +1641,35 @@
 p%22, new URI(
-u
+serviceBusU
 ri).getAutho
@@ -1684,17 +1684,27 @@
 new URI(
-u
+serviceBusU
 ri).getP
@@ -1715,16 +1715,32 @@
 ), null,
+%0A               
  null).t

Fix unit test