use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpSend in project azure-iot-sdk-java by Azure.
the class AmqpSendTest method constructor_checks_if_userName_empty.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_001: [The constructor shall throw IllegalArgumentException if any of the input parameter is null or empty]
// Assert
@Test(expected = IllegalArgumentException.class)
public void constructor_checks_if_userName_empty() {
// Arrange
String hostName = "aaa";
String userName = "";
String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Act
AmqpSend amqpSend = new AmqpSend(hostName, userName, sasToken, iotHubServiceClientProtocol);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpSend in project azure-iot-sdk-java by Azure.
the class AmqpSendTest method constructor_checks_if_sasToken_empty.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_001: [The constructor shall throw IllegalArgumentException if any of the input parameter is null or empty]
// Assert
@Test(expected = IllegalArgumentException.class)
public void constructor_checks_if_sasToken_empty() {
// Arrange
String hostName = "aaa";
String userName = "bbb";
String sasToken = "";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Act
AmqpSend amqpSend = new AmqpSend(hostName, userName, sasToken, iotHubServiceClientProtocol);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpSend in project azure-iot-sdk-java by Azure.
the class AmqpSendTest method constructor_checks_if_hostName_empty.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_001: [The constructor shall throw IllegalArgumentException if any of the input parameter is null or empty]
// Assert
@Test(expected = IllegalArgumentException.class)
public void constructor_checks_if_hostName_empty() {
// Arrange
String hostName = "";
String userName = "bbb";
String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Act
AmqpSend amqpSend = new AmqpSend(hostName, userName, sasToken, iotHubServiceClientProtocol);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpSend in project azure-iot-sdk-java by Azure.
the class AmqpSendTest method onReactorInit_creates_SendHandler.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_003: [The event handler shall set the member AmqpsSendHandler object to handle the given connection events]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_004: [The event handler shall create an AmqpsSendHandler object to handle reactor events]
@Test
public void onReactorInit_creates_SendHandler() throws IOException {
// Arrange
String hostName = "aaa";
String userName = "bbb";
String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
AmqpSend amqpSend = new AmqpSend(hostName, userName, sasToken, iotHubServiceClientProtocol);
amqpSend.open();
// Assert
new Expectations() {
{
reactor = event.getReactor();
connection = reactor.connection(Deencapsulation.getField(amqpSend, "amqpSendHandler"));
}
};
// Act
amqpSend.onReactorInit(event);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpSend in project azure-iot-sdk-java by Azure.
the class AmqpSendTest method constructor_checks_if_sasToken_null.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_001: [The constructor shall throw IllegalArgumentException if any of the input parameter is null or empty]
// Assert
@Test(expected = IllegalArgumentException.class)
public void constructor_checks_if_sasToken_null() {
// Arrange
String hostName = "aaa";
String userName = "bbb";
String sasToken = null;
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Act
AmqpSend amqpSend = new AmqpSend(hostName, userName, sasToken, iotHubServiceClientProtocol);
}
Aggregations