Search in sources :

Example 1 with Environment

use of com.yahoo.vespa.hosted.node.admin.component.Environment in project vespa by vespa-engine.

the class FilebeatConfigProviderTest method it_does_not_add_double_quotes.

@Test
public void it_does_not_add_double_quotes() {
    Environment environment = getEnvironment(ImmutableList.of("unquoted", "\"quoted\""));
    FilebeatConfigProvider filebeatConfigProvider = new FilebeatConfigProvider(environment);
    Optional<String> config = filebeatConfigProvider.getConfig(getNodeSpec(tenant, application, instance));
    assertThat(config.get(), containsString("hosts: [\"unquoted\",\"quoted\"]"));
}
Also used : Environment(com.yahoo.vespa.hosted.node.admin.component.Environment) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 2 with Environment

use of com.yahoo.vespa.hosted.node.admin.component.Environment in project vespa by vespa-engine.

the class FilebeatConfigProviderTest method it_does_not_generate_config_when_no_logstash_nodes.

@Test
public void it_does_not_generate_config_when_no_logstash_nodes() {
    Environment env = getEnvironment(Collections.emptyList());
    FilebeatConfigProvider filebeatConfigProvider = new FilebeatConfigProvider(env);
    Optional<String> config = filebeatConfigProvider.getConfig(getNodeSpec(tenant, application, instance));
    assertFalse(config.isPresent());
}
Also used : Environment(com.yahoo.vespa.hosted.node.admin.component.Environment) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

Environment (com.yahoo.vespa.hosted.node.admin.component.Environment)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Test (org.junit.Test)2