use of com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsTransport in project azure-iot-sdk-java by Azure.
the class AmqpsTransportTest method isEmptyReturnsTrue.
// Tests_SRS_AMQPSTRANSPORT_15_035: [The function shall return true if the waiting list,
// in progress list and callback list are all empty, and false otherwise.]
@Test
public void isEmptyReturnsTrue() throws IOException {
AmqpsTransport transport = new AmqpsTransport(mockConfig, false);
Boolean isEmpty = transport.isEmpty();
Assert.assertTrue(isEmpty);
}
use of com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsTransport in project azure-iot-sdk-java by Azure.
the class AmqpsTransportTest method messageReceivedAddsTheMessageToTheListOfMessagesToBeProcessed.
// Tests_SRS_AMQPSTRANSPORT_15_034: [The message received is added to the list of messages to be processed.]
@Test
public void messageReceivedAddsTheMessageToTheListOfMessagesToBeProcessed() throws IOException {
new NonStrictExpectations() {
{
new AmqpsIotHubConnection(mockConfig, false);
result = mockConnection;
}
};
AmqpsTransport transport = new AmqpsTransport(mockConfig, false);
transport.open();
Queue<AmqpsMessage> receivedMessages = new LinkedBlockingQueue<>();
receivedMessages.add(mockAmqpsMessage);
receivedMessages.add(mockAmqpsMessage);
Deencapsulation.setField(transport, "receivedMessages", receivedMessages);
transport.messageReceived(mockAmqpsMessage);
Assert.assertTrue(receivedMessages.size() == 3);
}
Aggregations