Class TestRoot


  • public class TestRoot
    extends Object
    Test utility class that provides many methods for inspecting the state of a completely built model
    Since:
    5.1
    Author:
    Ulf Lilleengen
    • Method Detail

      • getConfigModels

        public <MODEL extends ConfigModelList<MODEL> getConfigModels​(Class<MODEL> clazz)
        Get a list of all config models of a particular type.
        Parameters:
        clazz - The class of the models to find.
        Returns:
        A list of models of given type.
      • getConfig

        public <BUILDER extends com.yahoo.config.ConfigInstance.Builder> BUILDER getConfig​(BUILDER builder,
                                                                                           String configId)
        Ask model to populate builder with config for a given config id. This method gives the same config as the configserver would return to its clients.
        Parameters:
        builder - The builder to populate
        configId - The config id of the producer to ask for config.
        Returns:
        the same builder.
      • getConfig

        public <CONFIGTYPE extends com.yahoo.config.ConfigInstance> CONFIGTYPE getConfig​(Class<CONFIGTYPE> clazz,
                                                                                         String configId)
        Request config of a given type and id. This method gives the same config as the configserver would return to its clients.
        Parameters:
        clazz - Type of config to request.
        configId - The config id of the producer to ask for config.
        Returns:
        A config object of the appropriate type with config values set.
      • getHosts

        public List<HostResource> getHosts()
        Retrieve the hosts available in this model. Useful to verify that hostnames are set correctly etc.
        Returns:
        A list of hosts.