use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class EventDefinitionFacadeTest method listExcerpts.
@Test
@MongoDBFixtures("EventDefinitionFacadeTest.json")
public void listExcerpts() {
final Set<EntityExcerpt> excerpts = facade.listEntityExcerpts();
final EntityExcerpt excerpt = excerpts.iterator().next();
assertThat(excerpt.title()).isEqualTo("title");
assertThat(excerpt.id()).isEqualTo(ModelId.of("5d4032513d2746703d1467f6"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.EVENT_DEFINITION_V1);
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class GrokPatternFacadeTest method createExcerpt.
@Test
public void createExcerpt() {
final GrokPattern grokPattern = GrokPattern.create("01234567890", "name", "pattern", null);
final EntityExcerpt excerpt = facade.createExcerpt(grokPattern);
assertThat(excerpt.id()).isEqualTo(ModelId.of("01234567890"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.GROK_PATTERN_V1);
assertThat(excerpt.title()).isEqualTo(grokPattern.name());
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class GrokPatternFacadeTest method listEntityExcerpts.
@Test
public void listEntityExcerpts() throws ValidationException {
grokPatternService.save(GrokPattern.create("Test1", "[a-z]+"));
grokPatternService.save(GrokPattern.create("Test2", "[a-z]+"));
final EntityExcerpt expectedEntityExcerpt1 = EntityExcerpt.builder().id(ModelId.of("1")).type(ModelTypes.GROK_PATTERN_V1).title("Test1").build();
final EntityExcerpt expectedEntityExcerpt2 = EntityExcerpt.builder().id(ModelId.of("2")).type(ModelTypes.GROK_PATTERN_V1).title("Test2").build();
final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
assertThat(entityExcerpts).hasSize(2).contains(expectedEntityExcerpt1, expectedEntityExcerpt2);
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class LookupCacheFacadeTest method createExcerpt.
@Test
public void createExcerpt() {
final CacheDto cacheDto = CacheDto.builder().id("1234567890").name("cache-name").title("Cache Title").description("Cache Description").config(new FallbackCacheConfig()).build();
final EntityExcerpt excerpt = facade.createExcerpt(cacheDto);
assertThat(excerpt.id()).isEqualTo(ModelId.of("1234567890"));
assertThat(excerpt.type()).isEqualTo(ModelTypes.LOOKUP_CACHE_V1);
assertThat(excerpt.title()).isEqualTo("Cache Title");
}
use of org.graylog2.contentpacks.model.entities.EntityExcerpt in project graylog2-server by Graylog2.
the class LookupCacheFacadeTest method listEntityExcerpts.
@Test
@MongoDBFixtures("LookupCacheFacadeTest.json")
public void listEntityExcerpts() {
final EntityExcerpt expectedEntityExcerpt = EntityExcerpt.builder().id(ModelId.of("5adf24b24b900a0fdb4e52dd")).type(ModelTypes.LOOKUP_CACHE_V1).title("No-op cache").build();
final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt);
}
Aggregations