@Test
public void testMapping() {

    PropertyDescriptor desc = TestPropertyValidationContext.createDescriptor("boolean", false, Arrays.asList("true", "false"), "false");
    desc.setValidator("BOOLEAN_VALIDATOR");
    desc.setDescription("oh description");
    desc.setSensitive(false);
    org.apache.nifi.components.PropertyDescriptor otherDescriptor = DescriptorUtils.toComponentDescriptor(desc);
    // can't use a reflection equals since they are different types
    assertEquals(desc.getAllowableValues().size(),otherDescriptor.getAllowableValues().size());
    assertEquals(desc.getDefaultValue(),otherDescriptor.getDefaultValue());
    assertEquals(desc.getDescription(),otherDescriptor.getDescription());
    assertEquals(desc.getDisplayName(),otherDescriptor.getDisplayName());
    assertEquals(desc.getName(),otherDescriptor.getName());
    assertEquals(desc.getSensitive(),otherDescriptor.isSensitive());
    assertEquals(desc.getRequired(),otherDescriptor.isRequired());
}