### Question:
AttributeTypePropertyDefinition extends PropertyDefinition<AttributeType> { @Override public AttributeType decodeValue(String value) { Reject.ifNull(value); final String name = value.trim(); if (!ConfigurationFramework.getInstance().isClient() && !Schema.getDefaultSchema().hasAttributeType(name)) { throw PropertyException.illegalPropertyValueException(this, value); } final AttributeType type = Schema.getDefaultSchema().asNonStrictSchema().getAttributeType(name); try { validateValue(type); return type; } catch (PropertyException e) { throw PropertyException.illegalPropertyValueException(this, value); } } private  AttributeTypePropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        EnumSet<PropertyOption> options, AdministratorAction adminAction,
        DefaultBehaviorProvider<AttributeType> defaultBehavior); static Builder createBuilder(AbstractManagedObjectDefinition<?, ?> d, String propertyName); @Override R accept(PropertyDefinitionVisitor<R, P> v, P p); @Override R accept(PropertyValueVisitor<R, P> v, AttributeType value, P p); @Override int compare(AttributeType o1, AttributeType o2); @Override AttributeType decodeValue(String value); @Override String encodeValue(AttributeType value); @Override void validateValue(AttributeType value);  }### Answer:
@Test(dataProvider = "valueLegalData") public void testDecodeValue(String value) { AttributeTypePropertyDefinition propertyDef = createPropertyDefinition(); AttributeType expected = Schema.getDefaultSchema().getAttributeType(value); assertEquals(propertyDef.decodeValue(value), expected); }
@Test(dataProvider = "valueIllegalData", expectedExceptions = { PropertyException.class }) public void testDecodeValueIllegal(String value) { ConfigurationFramework.getInstance().setIsClient(false); try { AttributeTypePropertyDefinition propertyDef = createPropertyDefinition(); propertyDef.decodeValue(value); } finally { ConfigurationFramework.getInstance().setIsClient(true); } }
@Test(dataProvider = "valueIllegalData") public void testDecodeValueIllegalNoSchemaCheck(String value) { AttributeTypePropertyDefinition propertyDef = createPropertyDefinition(); AttributeType type = propertyDef.decodeValue(value); assertEquals(type.getNameOrOID(), value); }