use of com.microsoft.azure.sdk.iot.device.net.IotHubEventUri in project azure-iot-sdk-java by Azure.
the class IotHubEventUriTest method getHostnameIsCorrect.
// Tests_SRS_IOTHUBEVENTURI_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;
}
};
IotHubEventUri eventUri = new IotHubEventUri(iotHubHostname, deviceId, "");
String testHostname = eventUri.getHostname();
assertThat(testHostname, is(hostname));
}
use of com.microsoft.azure.sdk.iot.device.net.IotHubEventUri in project azure-iot-sdk-java by Azure.
the class IotHubEventUriTest method getPathIsCorrect.
// Tests_SRS_IOTHUBEVENTURI_11_004: [The function shall return a URI with the format '/devices/[deviceId]/messages/events'.]
@Test
public void getPathIsCorrect() throws URISyntaxException {
final String iotHubHostname = "test.iothub";
final String deviceId = "test-deviceid";
final String path = "test-path";
new NonStrictExpectations() {
{
mockIotHubUri.getPath();
result = path;
}
};
IotHubEventUri eventUri = new IotHubEventUri(iotHubHostname, deviceId, "");
String testPath = eventUri.getPath();
assertThat(testPath, is(path));
}
Aggregations