use of com.microsoft.azure.sdk.iot.device.Template in project azure-iot-sdk-java by Azure.
the class TemplateTest method testOpenCreatesNewSet.
// Tests_SRS_TEMPLATE_99_004: [The method shall create a new instance of the unionSet .]
@Test
public void testOpenCreatesNewSet(@Mocked final Set<String> mockedSet) {
//arrange
final String testString = "testString";
/* Set any expectations on mocked object */
new NonStrictExpectations() {
{
}
};
/* Use Deencapsulation or reflection to access objects that are not scoped for test */
Template testObject = Deencapsulation.newInstance(Template.class, testString);
//act
/* Use Deencapsulation or reflection to access objects that are not scoped for test */
Deencapsulation.invoke(testObject, "open");
//assert
/* Use Deencapsulation or reflection to access objects that are not scoped for test */
final Set actualSet = Deencapsulation.getField(testObject, "unionSet");
assertNotNull(actualSet);
assertEquals(actualSet, mockedSet);
/* Verify any call flow on mocked objects that is expected on act */
new Verifications() {
{
new HashSet<>();
}
};
}
Aggregations