DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeDesign", DesignDef.class);
assertNotNull("DesignDef not found!", c);
assertTrue("DesignDef not found!", c.getDescriptor().exists());
Map<DefDescriptor<AttributeDesignDef>, AttributeDesignDef> attrs = c.getAttributeDesignDefs();
assertFalse("Unable to parse AttributeDesignDefs on DesignDef!", attrs == null || attrs.size() == 0);
AttributeDesignDef attr = c.getAttributeDesignDef("something");
assertNotNull("AttributeDesignDef 'something' not found!", attr);
assertEquals("AttributeDesignDef 'something' name is incorrect.", "something", attr.getName());
assertEquals("AttributeDesignDef 'something' label is incorrect.", "some label", attr.getLabel());
assertEquals("AttributeDesignDef 'something' placeholder is incorrect.", "Leave blank for default value",
attr.getPlaceholderText());
assertEquals("AttributeDesignDef 'something' min is incorrect.", "-100", attr.getMin());
assertEquals("AttributeDesignDef 'something' max is incorrect.", "100", attr.getMax());
AttributeDesignDef attr2 = c.getAttributeDesignDef("entities");
assertNotNull("AttributeDesignDef 'entities' not found!", attr2);
assertEquals("AttributeDesignDef 'entities' type is incorrect.", "EntityName", attr2.getType());
assertEquals("AttributeDesignDef 'entities' datasource is incorrect or has wrong format.", "Account,Contact",
attr2.getDataSource());
assertTrue("AttributeDesignDef 'entities' required is incorrect.", attr2.isRequired());
assertFalse("AttributeDesignDef 'entities' readonly is incorrect.", attr2.isReadOnly());
}