Search in sources :

Example 6 with ProvisioningDeviceClient

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

the class ProvisioningDeviceClientTest method closeNowTerminatedSucceeds.

@Test
public void closeNowTerminatedSucceeds() throws ProvisioningDeviceClientException {
    // arrange
    new NonStrictExpectations() {

        {
            mockedExecutorService.isTerminated();
            result = true;
        }
    };
    ProvisioningDeviceClient testProvisioningDeviceClient = ProvisioningDeviceClient.create(END_POINT, SCOPE_ID, TEST_PROTOCOL, mockedSecurityProvider);
    // act
    testProvisioningDeviceClient.closeNow();
    // assert
    new Verifications() {

        {
            mockedExecutorService.shutdownNow();
            times = 0;
        }
    };
}
Also used : ProvisioningDeviceClient(com.microsoft.azure.sdk.iot.provisioning.device.ProvisioningDeviceClient) Verifications(mockit.Verifications) NonStrictExpectations(mockit.NonStrictExpectations) Test(org.junit.Test)

Aggregations

ProvisioningDeviceClient (com.microsoft.azure.sdk.iot.provisioning.device.ProvisioningDeviceClient)6 Test (org.junit.Test)6 Verifications (mockit.Verifications)4 NonStrictExpectations (mockit.NonStrictExpectations)2 ProvisioningDeviceClientStatus (com.microsoft.azure.sdk.iot.provisioning.device.ProvisioningDeviceClientStatus)1 SecurityProvider (com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider)1 SecurityProviderTPMEmulator (com.microsoft.azure.sdk.iot.provisioning.security.hsm.SecurityProviderTPMEmulator)1 ProvisioningServiceClient (com.microsoft.azure.sdk.iot.provisioning.service.ProvisioningServiceClient)1 Attestation (com.microsoft.azure.sdk.iot.provisioning.service.configs.Attestation)1 IndividualEnrollment (com.microsoft.azure.sdk.iot.provisioning.service.configs.IndividualEnrollment)1 TpmAttestation (com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1