Search in sources :

Example 1 with ResponseCallback

use of com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.ResponseCallback in project azure-iot-sdk-java by Azure.

the class AmqpsProvisioningSaslHandlerTest method constructorSavesArgumentValues.

// Tests_SRS_AMQPSPROVISIONINGSASLHANDLER_34_001: [This constructor shall save the provided idScope, registrationId, endorsementKey, storageRootKey, responseCallback and autorizationCallbackContext .]
@Test
public void constructorSavesArgumentValues() {
    // act
    AmqpsProvisioningSaslHandler handler = Deencapsulation.newInstance(AmqpsProvisioningSaslHandler.class, new Class[] { String.class, String.class, byte[].class, byte[].class, ResponseCallback.class, Object.class }, idScope, registrationId, endorsementKey, storageRootKey, mockedResponseCallback, new Object());
    // assert
    String actualIdScope = Deencapsulation.getField(handler, "idScope");
    String actualRegistrationId = Deencapsulation.getField(handler, "registrationId");
    byte[] actualEndorsementKey = Deencapsulation.getField(handler, "endorsementKey");
    byte[] actualStorageRootKey = Deencapsulation.getField(handler, "storageRootKey");
    ResponseCallback actualNonceCallback = Deencapsulation.getField(handler, "responseCallback");
    String actualSasToken = Deencapsulation.getField(handler, "sasToken");
    assertEquals(idScope, actualIdScope);
    assertEquals(registrationId, actualRegistrationId);
    assertEquals(endorsementKey, actualEndorsementKey);
    assertEquals(storageRootKey, actualStorageRootKey);
    assertEquals(mockedResponseCallback, actualNonceCallback);
    assertNull(actualSasToken);
}
Also used : ResponseCallback(com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.ResponseCallback) AmqpsProvisioningSaslHandler(com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.amqp.AmqpsProvisioningSaslHandler) Test(org.junit.Test)

Aggregations

ResponseCallback (com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.ResponseCallback)1 AmqpsProvisioningSaslHandler (com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.amqp.AmqpsProvisioningSaslHandler)1 Test (org.junit.Test)1