use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AccessRight in project open-smart-grid-platform by OSGP.
the class AssociationLnListTypeMappingTest method testAssociationLnListTypeMappingWithNonEmptyLists.
@Test
public void testAssociationLnListTypeMappingWithNonEmptyLists() {
// build test data
final List<AttributeAccessItem> listAttributeAccessItem = new ArrayList<>();
final AttributeAccessModeType accessMode = AttributeAccessModeType.NO_ACCESS;
final List<Integer> listInteger = new ArrayList<>();
final AccessSelectorList accessSelectors = new AccessSelectorList(listInteger);
listAttributeAccessItem.add(new AttributeAccessItem(1, accessMode, accessSelectors));
final AttributeAccessDescriptor attributeAccessDescriptor = new AttributeAccessDescriptor(listAttributeAccessItem);
final List<MethodAccessItem> listMethodAccessItem = new ArrayList<>();
final MethodAccessDescriptor methodAccessDescriptor = new MethodAccessDescriptor(listMethodAccessItem);
final AssociationLnListElement associationLnElement = new AssociationLnListElement(72, 2, new CosemObisCode(new int[] { 1, 1, 1, 1, 1, 1 }), new AccessRight(attributeAccessDescriptor, methodAccessDescriptor));
final AssociationLnListType associationLnListType = new AssociationLnListTypeBuilder().withNonEmptyLists(associationLnElement).build();
// actual mapping
final AssociationLnListTypeDto associationLnListTypeDto = this.configurationMapper.map(associationLnListType, AssociationLnListTypeDto.class);
// check values
assertThat(associationLnListTypeDto).isNotNull();
this.checkAssociationLnListElementMapping(associationLnListType.getAssociationLnListElement(), associationLnListTypeDto.getAssociationLnListElement());
}
Aggregations