Search in sources :

Example 6 with IotHubMessageUri

use of com.microsoft.azure.sdk.iot.device.net.IotHubMessageUri in project azure-iot-sdk-java by Azure.

the class IotHubMessageUriTest method getHostnameIsCorrect.

// Tests_SRS_IOTHUBMESSAGEURI_11_003: [The function shall return the hostname given in the constructor.]
@Test
public void getHostnameIsCorrect() throws URISyntaxException {
    final String iotHubHostname = "test.iothub";
    final String deviceId = "test-deviceid";
    final String hostname = "test-hostname";
    new NonStrictExpectations() {

        {
            mockIotHubUri.getHostname();
            result = hostname;
        }
    };
    IotHubMessageUri messageUri = new IotHubMessageUri(iotHubHostname, deviceId, "");
    String testHostname = messageUri.getHostname();
    assertThat(testHostname, is(hostname));
}
Also used : IotHubMessageUri(com.microsoft.azure.sdk.iot.device.net.IotHubMessageUri) NonStrictExpectations(mockit.NonStrictExpectations) Test(org.junit.Test)

Aggregations

IotHubMessageUri (com.microsoft.azure.sdk.iot.device.net.IotHubMessageUri)6 NonStrictExpectations (mockit.NonStrictExpectations)6 Test (org.junit.Test)6