Search in sources :

Example 6 with SuperModelProvider

use of com.yahoo.config.model.api.SuperModelProvider in project vespa by vespa-engine.

the class InstanceValidatorTest method mockSuperModelProvider.

private SuperModelProvider mockSuperModelProvider(ApplicationInfo... appInfos) {
    SuperModel superModel = new SuperModel(Stream.of(appInfos).collect(Collectors.groupingBy(appInfo -> appInfo.getApplicationId().tenant(), Collectors.toMap(ApplicationInfo::getApplicationId, Function.identity()))));
    SuperModelProvider superModelProvider = mock(SuperModelProvider.class);
    when(superModelProvider.getSuperModel()).thenReturn(superModel);
    return superModelProvider;
}
Also used : SuperModel(com.yahoo.config.model.api.SuperModel) SuperModelProvider(com.yahoo.config.model.api.SuperModelProvider)

Aggregations

SuperModelProvider (com.yahoo.config.model.api.SuperModelProvider)6 Test (org.junit.Test)5 ServiceInfo (com.yahoo.config.model.api.ServiceInfo)2 SuperModel (com.yahoo.config.model.api.SuperModel)2 ApplicationInfo (com.yahoo.config.model.api.ApplicationInfo)1 Zone (com.yahoo.config.provision.Zone)1 ServiceModel (com.yahoo.vespa.service.monitor.ServiceModel)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1