Search in sources :

Example 6 with Reference

use of org.graylog2.contentpacks.model.entities.references.Reference in project graylog2-server by Graylog2.

the class ReferenceConverterTest method convertStringValue.

@Test
public void convertStringValue() {
    final Reference reference = createReference("string", "yolo");
    assertThat(reference).isEqualTo(ValueReference.of("yolo"));
}
Also used : ValueReference(org.graylog2.contentpacks.model.entities.references.ValueReference) Reference(org.graylog2.contentpacks.model.entities.references.Reference) Test(org.junit.Test)

Example 7 with Reference

use of org.graylog2.contentpacks.model.entities.references.Reference in project graylog2-server by Graylog2.

the class ReferenceConverterTest method convertParameterValue.

@Test
public void convertParameterValue() {
    final Reference reference = createReference("parameter", "wat");
    assertThat(reference).isEqualTo(ValueReference.createParameter("wat"));
}
Also used : ValueReference(org.graylog2.contentpacks.model.entities.references.ValueReference) Reference(org.graylog2.contentpacks.model.entities.references.Reference) Test(org.junit.Test)

Example 8 with Reference

use of org.graylog2.contentpacks.model.entities.references.Reference in project graylog2-server by Graylog2.

the class ReferenceConverterTest method convertBooleanValue.

@Test
public void convertBooleanValue() {
    final Reference reference = createReference("boolean", false);
    assertThat(reference).isEqualTo(ValueReference.of(false));
}
Also used : ValueReference(org.graylog2.contentpacks.model.entities.references.ValueReference) Reference(org.graylog2.contentpacks.model.entities.references.Reference) Test(org.junit.Test)

Example 9 with Reference

use of org.graylog2.contentpacks.model.entities.references.Reference in project graylog2-server by Graylog2.

the class ReferenceConverterTest method convertIntegerValue.

@Test
public void convertIntegerValue() {
    final Reference reference = createReference("integer", 0);
    assertThat(reference).isEqualTo(ValueReference.of(0));
}
Also used : ValueReference(org.graylog2.contentpacks.model.entities.references.ValueReference) Reference(org.graylog2.contentpacks.model.entities.references.Reference) Test(org.junit.Test)

Example 10 with Reference

use of org.graylog2.contentpacks.model.entities.references.Reference in project graylog2-server by Graylog2.

the class ReferenceConverterTest method convertLongValue.

@Test
public void convertLongValue() {
    final Reference reference = createReference("long", 1);
    assertThat(reference).isEqualTo(ValueReference.of(1L));
}
Also used : ValueReference(org.graylog2.contentpacks.model.entities.references.ValueReference) Reference(org.graylog2.contentpacks.model.entities.references.Reference) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)9 Reference (org.graylog2.contentpacks.model.entities.references.Reference)8 ValueReference (org.graylog2.contentpacks.model.entities.references.ValueReference)8 Message (org.graylog2.plugin.Message)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 Map (java.util.Map)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SerializationFeature (com.fasterxml.jackson.databind.SerializationFeature)1 Duration (com.github.joschi.jadconfig.util.Duration)1 Strings (com.google.common.base.Strings)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterators (com.google.common.collect.Iterators)1 Ints (com.google.common.primitives.Ints)1 JestClient (io.searchbox.client.JestClient)1 JestResult (io.searchbox.client.JestResult)1 Health (io.searchbox.cluster.Health)1 State (io.searchbox.cluster.State)1 Bulk (io.searchbox.core.Bulk)1