use of mockit.NonStrictExpectations in project azure-iot-sdk-java by Azure.
the class ProvisioningServiceClientTest method deleteDeviceRegistrationStateWithIdSucceed.
/* SRS_PROVISIONING_SERVICE_CLIENT_21_025: [The deleteDeviceRegistrationState shall delete the deviceRegistrationState for the provided id by calling the delete in the registrationStatusManager.] */
@Test
public void deleteDeviceRegistrationStateWithIdSucceed() throws ProvisioningServiceClientException {
// arrange
final String id = "valid-id";
ProvisioningServiceClient provisioningServiceClient = createClient();
new NonStrictExpectations() {
{
Deencapsulation.invoke(mockedRegistrationStatusManager, "delete", new Class[] { String.class, String.class }, id, null);
times = 1;
}
};
// act
provisioningServiceClient.deleteDeviceRegistrationState(id);
// assert
}
use of mockit.NonStrictExpectations in project azure-iot-sdk-java by Azure.
the class ProvisioningServiceClientTest method deleteIndividualEnrollmentWithRegistrationIdAndEtagSucceed.
/* SRS_PROVISIONING_SERVICE_CLIENT_21_013: [The deleteIndividualEnrollment shall delete the individualEnrollment for the provided registrationId and etag by calling the delete in the individualEnrollmentManager.] */
@Test
public void deleteIndividualEnrollmentWithRegistrationIdAndEtagSucceed() throws ProvisioningServiceClientException {
// arrange
final String registrationId = "valid-registration-id";
final String eTag = "valid-eTag";
ProvisioningServiceClient provisioningServiceClient = createClient();
new NonStrictExpectations() {
{
Deencapsulation.invoke(mockedIndividualEnrollmentManager, "delete", registrationId, eTag);
times = 1;
}
};
// act
provisioningServiceClient.deleteIndividualEnrollment(registrationId, eTag);
// assert
}
use of mockit.NonStrictExpectations in project azure-iot-sdk-java by Azure.
the class ProvisioningServiceClientTest method deleteEnrollmentGroupWithEnrollmentGroupIdSucceed.
/* SRS_PROVISIONING_SERVICE_CLIENT_21_019: [The deleteEnrollmentGroup shall delete the enrollmentGroup for the provided enrollmentGroupId by calling the delete in the enrollmentGroupManager.] */
@Test
public void deleteEnrollmentGroupWithEnrollmentGroupIdSucceed() throws ProvisioningServiceClientException {
// arrange
final String enrollmentGroupId = "valid-enrollmentGroupId";
ProvisioningServiceClient provisioningServiceClient = createClient();
new NonStrictExpectations() {
{
Deencapsulation.invoke(mockedEnrollmentGroupManager, "delete", new Class[] { String.class, String.class }, enrollmentGroupId, null);
times = 1;
}
};
// act
provisioningServiceClient.deleteEnrollmentGroup(enrollmentGroupId);
// assert
}
use of mockit.NonStrictExpectations in project azure-iot-sdk-java by Azure.
the class ProvisioningServiceClientTest method deleteIndividualEnrollmentWithRegistrationIdSucceed.
/* SRS_PROVISIONING_SERVICE_CLIENT_21_012: [The deleteIndividualEnrollment shall delete the individualEnrollment for the provided registrationId by calling the delete in the individualEnrollmentManager.] */
@Test
public void deleteIndividualEnrollmentWithRegistrationIdSucceed() throws ProvisioningServiceClientException {
// arrange
final String registrationId = "valid-registration-id";
ProvisioningServiceClient provisioningServiceClient = createClient();
new NonStrictExpectations() {
{
Deencapsulation.invoke(mockedIndividualEnrollmentManager, "delete", new Class[] { String.class, String.class }, registrationId, null);
times = 1;
}
};
// act
provisioningServiceClient.deleteIndividualEnrollment(registrationId);
// assert
}
use of mockit.NonStrictExpectations in project azure-iot-sdk-java by Azure.
the class ProvisioningServiceClientTest method createRegistrationStateQueryWithPageSizeSucceed.
/* SRS_PROVISIONING_SERVICE_CLIENT_21_028: [The createEnrollmentGroupRegistrationStateQuery shall create a new deviceRegistrationState query by calling the createQuery in the registrationStatusManager.] */
@Test
public void createRegistrationStateQueryWithPageSizeSucceed(@Mocked final QuerySpecification mockedQuerySpecification) throws ProvisioningServiceClientException {
// arrange
final String enrollmentGroupId = "valid-enrollmentGroupId";
ProvisioningServiceClient provisioningServiceClient = createClient();
new NonStrictExpectations() {
{
Deencapsulation.invoke(mockedRegistrationStatusManager, "createEnrollmentGroupQuery", mockedQuerySpecification, enrollmentGroupId, 10);
times = 1;
}
};
// act
Query query = provisioningServiceClient.createEnrollmentGroupRegistrationStateQuery(mockedQuerySpecification, enrollmentGroupId, 10);
// assert
assertNotNull(query);
}
Aggregations