AnnotationCatalogAccessorProvider extends AbstractAnnotationCatalogAccessorProvider implements InitializingBean { protected CatalogService buildCatalogService(Service service) { final String id = evaluate(service.id()); final String name = evaluate(service.name()); final String description = evaluate(service.description()); final boolean bindable = Boolean.valueOf(evaluate(service.bindable())); final boolean planUpdatable = Boolean.valueOf(evaluate(service.planUpdatable())); final List<String> tags = new ArrayList<>(); for (String tag : service.tags()) { tags.add(evaluate(tag)); } final Catalog.ServiceDashboardClient dashboardClient = buildDashboardClient(service.dashboardClient()); final Map<String, Object> metadata = buildMetadata(service.metadata()); final List<String> requires = new ArrayList<>(); for (Permission permission : service.requires()) { requires.add(permission.toString()); } final List<Catalog.Plan> plans = new ArrayList<>(); for (ServicePlan servicePlan : service.plans()) { final String planId = evaluate(servicePlan.id()); final String planName = evaluate(servicePlan.name()); final String planDescription = evaluate(servicePlan.description()); final boolean free = Boolean.valueOf(evaluate(servicePlan.free())); final Map<String, Object> planMetadata = buildMetadata(servicePlan.metadata()); plans.add(new Catalog.Plan(planId, planName, planDescription, free, planMetadata)); } return new CatalogService(id, name, description, bindable, tags, metadata, requires, plans, dashboardClient, planUpdatable); } AnnotationCatalogAccessorProvider(BeanExpressionResolver expressionResolver,
                                             BeanExpressionContext expressionContext); @Override CatalogAccessor getCatalogAccessor(); @Override void afterPropertiesSet();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void mixNullNotNullDashboardFields(){ @ServiceBroker( @Service(id = SERVICE_ID, name = SERVICE_NAME, description = SERVICE_DESCRIPTION, plans = {}, dashboardClient = @DashboardClient(secret = "secret")) ) class WrongBroker { } getProvider().buildCatalogService(WrongBroker.class.getAnnotation(ServiceBroker.class).value()[0]); }