FreemarkerModel.set(model);
final JsonTypeDefinition nameTypeDefinition = JsonTypeDefinition.createTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.json.Name"));
assertNull(model.findJsonTypeDefinition(nameTypeDefinition));
model.addJsonType(nameTypeDefinition);
assertNotNull(model.findJsonTypeDefinition(nameTypeDefinition));
JsonSchemaInfo jsonSchemaInfo = model.getIdsToJsonSchemas().get(JsonSchemaInfo.schemaIdForType(nameTypeDefinition));
assertNotNull(jsonSchemaInfo);
assertNotNull(jsonSchemaInfo.getTypesByName().get(nameTypeDefinition.getTypeName()));
assertNull(jsonSchemaInfo.getTopLevelTypesByName().get(nameTypeDefinition.getTypeName()));
}