use of com.microsoft.azure.sdk.iot.device.transport.amqps.IotHubReactor in project azure-iot-sdk-java by Azure.
the class AmqpsIotHubConnectionTest method openTriggersProtonReactor.
// Tests_SRS_AMQPSIOTHUBCONNECTION_15_009: [The function shall trigger the Reactor (Proton) to begin running.]
@Test
public void openTriggersProtonReactor() throws IOException, InterruptedException {
baseExpectations();
new NonStrictExpectations() {
{
new IotHubReactor((Reactor) any);
result = mockIotHubReactor;
mockIotHubReactor.run();
mockOpenLock.waitLock(anyLong);
}
};
AmqpsIotHubConnection connection = new AmqpsIotHubConnection(mockConfig, false);
Deencapsulation.setField(connection, "openLock", mockOpenLock);
connection.open();
new Verifications() {
{
new IotHubSasToken(mockConfig, anyLong);
times = 1;
new IotHubReactor((Reactor) any);
times = 1;
mockOpenLock.waitLock(anyLong);
times = 1;
}
};
}
Aggregations