Search in sources :

Example 26 with EntityExcerpt

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

the class NotificationFacadeTest method listExcerpts.

@Test
@MongoDBFixtures("NotificationFacadeTest.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("5d4d33753d27460ad18e0c4d"));
    assertThat(excerpt.type()).isEqualTo(ModelTypes.NOTIFICATION_V1);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 27 with EntityExcerpt

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

the class EventDefinitionFacadeTest method createExcerpt.

@Test
@MongoDBFixtures("EventDefinitionFacadeTest.json")
public void createExcerpt() {
    final Optional<EventDefinitionDto> eventDefinitionDto = eventDefinitionService.get("5d4032513d2746703d1467f6");
    assertThat(eventDefinitionDto).isPresent();
    final EntityExcerpt excerpt = facade.createExcerpt(eventDefinitionDto.get());
    assertThat(excerpt.title()).isEqualTo("title");
    assertThat(excerpt.id()).isEqualTo(ModelId.of("5d4032513d2746703d1467f6"));
    assertThat(excerpt.type()).isEqualTo(ModelTypes.EVENT_DEFINITION_V1);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) EventDefinitionDto(org.graylog.events.processor.EventDefinitionDto) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Aggregations

EntityExcerpt (org.graylog2.contentpacks.model.entities.EntityExcerpt)27 Test (org.junit.Test)26 MongoDBFixtures (org.graylog.testing.mongodb.MongoDBFixtures)15 NotFoundException (javax.ws.rs.NotFoundException)2 Date (java.util.Date)1 NotificationDto (org.graylog.events.notifications.NotificationDto)1 EventDefinitionDto (org.graylog.events.processor.EventDefinitionDto)1 GRN (org.graylog.grn.GRN)1 PipelineDao (org.graylog.plugins.pipelineprocessor.db.PipelineDao)1 RuleDao (org.graylog.plugins.pipelineprocessor.db.RuleDao)1 Collector (org.graylog.plugins.sidecar.rest.models.Collector)1 ViewDTO (org.graylog.plugins.views.search.views.ViewDTO)1 ViewSummaryDTO (org.graylog.plugins.views.search.views.ViewSummaryDTO)1 EntityDescriptor (org.graylog2.contentpacks.model.entities.EntityDescriptor)1 GrokPattern (org.graylog2.grok.GrokPattern)1 InputImpl (org.graylog2.inputs.InputImpl)1 CacheDto (org.graylog2.lookup.dto.CacheDto)1 DataAdapterDto (org.graylog2.lookup.dto.DataAdapterDto)1 LookupTableDto (org.graylog2.lookup.dto.LookupTableDto)1 FallbackAdapterConfig (org.graylog2.plugin.lookup.FallbackAdapterConfig)1