Search in sources :

Example 1 with ProvisioningDeviceClientContract

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

the class ProvisioningDeviceClientContractTest method createContractSucceedsHttp.

@Test
public void createContractSucceedsHttp() throws Exception {
    // arrange
    new NonStrictExpectations() {

        {
            mockedProvisioningDeviceClientConfig.getIdScope();
            result = TEST_SCOPE_ID;
            mockedProvisioningDeviceClientConfig.getProvisioningServiceGlobalEndpoint();
            result = TEST_URI;
            mockedProvisioningDeviceClientConfig.getProtocol();
            result = ProvisioningDeviceClientTransportProtocol.HTTPS;
        }
    };
    // act
    ProvisioningDeviceClientContract clientContract = ProvisioningDeviceClientContract.createProvisioningContract(mockedProvisioningDeviceClientConfig);
    // assert
    assertTrue(clientContract instanceof ContractAPIHttp);
}
Also used : ProvisioningDeviceClientContract(com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.ProvisioningDeviceClientContract) NonStrictExpectations(mockit.NonStrictExpectations) ContractAPIHttp(com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.http.ContractAPIHttp) Test(org.junit.Test)

Aggregations

ProvisioningDeviceClientContract (com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.ProvisioningDeviceClientContract)1 ContractAPIHttp (com.microsoft.azure.sdk.iot.provisioning.device.internal.contract.http.ContractAPIHttp)1 NonStrictExpectations (mockit.NonStrictExpectations)1 Test (org.junit.Test)1