use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpResponseVerification in project azure-iot-sdk-java by Azure.
the class AmqpResponseVerificationTest method getExceptionGets.
//Tests_SRS_SERVICE_SDK_JAVA_AMQPRESPONSEVERIFICATION_25_007: [** The function shall return the exception saved earlier by the constructor **]**
@Test
public void getExceptionGets() {
//Arrange
String errorDescription = "TestDescription";
new NonStrictExpectations() {
{
mockedRejected.getError();
result = mockedErrorCondition;
mockedErrorCondition.getCondition();
result = AmqpError.RESOURCE_LIMIT_EXCEEDED;
mockedErrorCondition.getDescription();
result = errorDescription;
}
};
//Act
AmqpResponseVerification testVerification = new AmqpResponseVerification(mockedRejected);
//Assert
new Verifications() {
{
assertTrue(testVerification.getException() instanceof IotHubDeviceMaximumQueueDepthExceededException);
}
};
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpResponseVerification in project azure-iot-sdk-java by Azure.
the class AmqpResponseVerificationTest method constructor_saves_if_accepted.
//Tests_SRS_SERVICE_SDK_JAVA_AMQPRESPONSEVERIFICATION_25_006: [** The function shall save null exception if the amqp delivery state is accepted or received or released or modified **]**
@Test
public void constructor_saves_if_accepted() {
//Act
AmqpResponseVerification testVerification = new AmqpResponseVerification(mockedAccepted);
//Assert
new Verifications() {
{
assertNull(testVerification.getException());
}
};
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpResponseVerification in project azure-iot-sdk-java by Azure.
the class AmqpResponseVerificationTest method constructor_saves_if_modified.
@Test
public void constructor_saves_if_modified() {
//Act
AmqpResponseVerification testVerification = new AmqpResponseVerification(mockedModified);
//Assert
new Verifications() {
{
assertNull(testVerification.getException());
}
};
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpResponseVerification in project azure-iot-sdk-java by Azure.
the class AmqpResponseVerificationTest method constructor_saves_NOT_FOUND_exception.
//Tests_SRS_SERVICE_SDK_JAVA_AMQPRESPONSEVERIFICATION_25_001: [** The function shall save IotHubNotFoundException if the amqp delivery state is rejected and error condition is amqp error code amqp:not-found **]**
@Test
public void constructor_saves_NOT_FOUND_exception() {
//Arrange
String errorDescription = "TestDescription";
new NonStrictExpectations() {
{
mockedRejected.getError();
result = mockedErrorCondition;
mockedErrorCondition.getCondition();
result = AmqpError.NOT_FOUND;
mockedErrorCondition.getDescription();
result = errorDescription;
}
};
//Act
AmqpResponseVerification testVerification = new AmqpResponseVerification(mockedRejected);
//Assert
new Verifications() {
{
assertTrue(testVerification.getException() instanceof IotHubNotFoundException);
}
};
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpResponseVerification in project azure-iot-sdk-java by Azure.
the class AmqpResponseVerificationTest method constructor_saves_if_received.
@Test
public void constructor_saves_if_received() {
//Act
AmqpResponseVerification testVerification = new AmqpResponseVerification(mockedReceived);
//Assert
new Verifications() {
{
assertNull(testVerification.getException());
}
};
}
Aggregations