use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class LookupTableFacadeTest method createExcerpt.
@Test
public void createExcerpt() {
final LookupTableDto lookupTableDto = LookupTableDto.builder().id("1234567890").name("lookup-table-name").title("Lookup Table Title").description("Lookup Table Description").dataAdapterId("data-adapter-1234").cacheId("cache-1234").defaultSingleValue("default-single").defaultSingleValueType(LookupDefaultValue.Type.STRING).defaultMultiValue("default-multi").defaultMultiValueType(LookupDefaultValue.Type.STRING).build();
final EntityExcerpt excerpt = facade.createExcerpt(lookupTableDto);
assertThat(excerpt.id()).isEqualTo(ModelId.of("1234567890"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.LOOKUP_TABLE_V1);
assertThat(excerpt.title()).isEqualTo("Lookup Table Title");
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class StreamCatalogTest method listEntityExcerpts.
@Test
@MongoDBFixtures("StreamCatalogTest.json")
public void listEntityExcerpts() {
final EntityExcerpt expectedEntityExcerpt1 = EntityExcerpt.builder().id(ModelId.of("000000000000000000000001")).type(ModelTypes.STREAM_V1).title("All messages").build();
final EntityExcerpt expectedEntityExcerpt2 = EntityExcerpt.builder().id(ModelId.of("5adf23894b900a0fdb4e517d")).type(ModelTypes.STREAM_V1).title("Test").build();
final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt1, expectedEntityExcerpt2);
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class StreamCatalogTest method createExcerpt.
@Test
public void createExcerpt() {
final ImmutableMap<String, Object> fields = ImmutableMap.of("title", "Stream Title");
final StreamImpl stream = new StreamImpl(fields);
final EntityExcerpt excerpt = facade.createExcerpt(stream);
assertThat(excerpt.id()).isEqualTo(ModelId.of(stream.getId()));
assertThat(excerpt.type()).isEqualTo(ModelTypes.STREAM_V1);
assertThat(excerpt.title()).isEqualTo(stream.getTitle());
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class PipelineRuleFacadeTest method createExcerpt.
@Test
public void createExcerpt() {
final RuleDao pipelineRule = RuleDao.builder().id("id").title("title").description("description").source("rule \"debug\"\nwhen\n true\nthen\n debug($message.message);\nend").build();
final EntityExcerpt excerpt = facade.createExcerpt(pipelineRule);
assertThat(excerpt.id()).isEqualTo(ModelId.of("id"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.PIPELINE_RULE_V1);
assertThat(excerpt.title()).isEqualTo("title");
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class SidecarCollectorFacadeTest method createExcerpt.
@Test
@MongoDBFixtures("SidecarCollectorFacadeTest.json")
public void createExcerpt() {
final Collector collector = collectorService.find("5b4c920b4b900a0024af0001");
final EntityExcerpt excerpt = facade.createExcerpt(collector);
assertThat(excerpt.id()).isEqualTo(ModelId.of("5b4c920b4b900a0024af0001"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.SIDECAR_COLLECTOR_V1);
assertThat(excerpt.title()).isEqualTo("filebeat");
}
Aggregations