use of com.microsoft.azure.sdk.iot.device.ProxySettings in project azure-iot-sdk-java by Azure.
the class ProxySettingsTest method getPortGetsPortFromAddress.
@Test
public void getPortGetsPortFromAddress() {
// arrange
final int expectedPort = 1234;
new Expectations() {
{
mockProxy.address();
result = mockInetSocketAddress;
mockInetSocketAddress.getPort();
result = expectedPort;
}
};
ProxySettings proxySettings = new ProxySettings(mockProxy);
// act
int actualPort = proxySettings.getPort();
// assert
assertEquals(expectedPort, actualPort);
}
Aggregations