Search in sources :

Example 11 with EntityExcerpt

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

the class ViewFacadeTest method itShouldListEntityExcerptsForAllViewsInDB.

@Test
@MongoDBFixtures("ViewFacadeTest.json")
public void itShouldListEntityExcerptsForAllViewsInDB() {
    final ViewDTO viewDTO = viewService.get(viewId).orElseThrow(() -> new NotFoundException("Missing view with id: " + viewId));
    final EntityExcerpt entityExcerpt = EntityExcerpt.builder().title(viewDTO.title()).id(ModelId.of(viewId)).type(ModelTypes.SEARCH_V1).build();
    final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
    assertThat(entityExcerpts).hasSize(1).contains(entityExcerpt);
}
Also used : ViewDTO(org.graylog.plugins.views.search.views.ViewDTO) EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) NotFoundException(javax.ws.rs.NotFoundException) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 12 with EntityExcerpt

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

the class LookupTableFacadeTest method listEntityExcerpts.

@Test
@MongoDBFixtures("LookupTableFacadeTest.json")
public void listEntityExcerpts() {
    final EntityExcerpt expectedEntityExcerpt = EntityExcerpt.builder().id(ModelId.of("5adf24dd4b900a0fdb4e530d")).type(ModelTypes.LOOKUP_TABLE_V1).title("HTTP DSV without Cache").build();
    final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
    assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 13 with EntityExcerpt

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

the class PipelineFacadeTest method listEntityExcerpts.

@Test
@MongoDBFixtures("PipelineFacadeTest/pipelines.json")
public void listEntityExcerpts() {
    final EntityExcerpt expectedEntityExcerpt = EntityExcerpt.builder().id(ModelId.of("5a85c4854b900afd5d662be3")).type(ModelTypes.PIPELINE_V1).title("Test").build();
    final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
    assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 14 with EntityExcerpt

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

the class LookupDataAdapterFacadeTest method listEntityExcerpts.

@Test
@MongoDBFixtures("LookupDataAdapterFacadeTest.json")
public void listEntityExcerpts() {
    final EntityExcerpt expectedEntityExcerpt = EntityExcerpt.builder().id(ModelId.of("5adf24a04b900a0fdb4e52c8")).type(ModelTypes.LOOKUP_ADAPTER_V1).title("HTTP DSV").build();
    final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
    assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 15 with EntityExcerpt

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

the class OutputFacadeTest method listEntityExcerpts.

@Test
@MongoDBFixtures("OutputFacadeTest.json")
public void listEntityExcerpts() {
    final EntityExcerpt expectedEntityExcerpt = EntityExcerpt.builder().id(ModelId.of("5adf239e4b900a0fdb4e5197")).type(ModelTypes.OUTPUT_V1).title("STDOUT").build();
    final Set<EntityExcerpt> entityExcerpts = facade.listEntityExcerpts();
    assertThat(entityExcerpts).containsOnly(expectedEntityExcerpt);
}
Also used : EntityExcerpt(org.graylog2.contentpacks.model.entities.EntityExcerpt) 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