Search in sources :

Example 1 with MigrationCompleted

use of org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted in project graylog2-server by Graylog2.

the class V20191203120602_MigrateSavedSearchesToViewsTest method migrateSavedSearchRelativeWithIntervalField.

@Test
@MongoDBFixtures("sample_saved_search_relative_with_interval_field.json")
public void migrateSavedSearchRelativeWithIntervalField() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5c7e5499f38ed7e1d8d6a613", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_relative_with_interval_field-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_relative_with_interval_field-expected_searches.json"));
}
Also used : AbstractMap(java.util.AbstractMap) MigrationCompleted(org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 2 with MigrationCompleted

use of org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted in project graylog2-server by Graylog2.

the class V20191203120602_MigrateSavedSearchesToViewsTest method migrateSavedSearchWithRelativeTimerange.

@Test
@MongoDBFixtures("sample_saved_search_relative.json")
public void migrateSavedSearchWithRelativeTimerange() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5c7e5499f38ed7e1d8d6a613", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_relative-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_relative-expected_searches.json"));
}
Also used : AbstractMap(java.util.AbstractMap) MigrationCompleted(org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 3 with MigrationCompleted

use of org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted in project graylog2-server by Graylog2.

the class V20191203120602_MigrateSavedSearchesToViewsTest method migrateSavedSearchWithMissingFields.

@Test
@MongoDBFixtures("sample_saved_search_with_missing_fields.json")
public void migrateSavedSearchWithMissingFields() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660b7b2d44b5813c1d7f6", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_with_missing_fields-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_with_missing_fields-expected_searches.json"));
}
Also used : AbstractMap(java.util.AbstractMap) MigrationCompleted(org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 4 with MigrationCompleted

use of org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted in project graylog2-server by Graylog2.

the class V20191203120602_MigrateSavedSearchesToViewsTest method migrateSavedSearchWithoutMessageRow.

@Test
@MongoDBFixtures("sample_saved_search_without_message_row.json")
public void migrateSavedSearchWithoutMessageRow() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5c7e5499f38ed7e1d8d6a613", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_without_message_row-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_without_message_row-expected_searches.json"));
}
Also used : AbstractMap(java.util.AbstractMap) MigrationCompleted(org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Example 5 with MigrationCompleted

use of org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted in project graylog2-server by Graylog2.

the class V20191203120602_MigrateSavedSearchesToViewsTest method migrateSavedSearchWithStreamId.

@Test
@MongoDBFixtures("sample_saved_search_with_stream.json")
public void migrateSavedSearchWithStreamId() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660b7b2d44b5813c1d7f6", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_with_stream-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_with_stream-expected_searches.json"));
}
Also used : AbstractMap(java.util.AbstractMap) MigrationCompleted(org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted) MongoDBFixtures(org.graylog.testing.mongodb.MongoDBFixtures) Test(org.junit.Test)

Aggregations

MigrationCompleted (org.graylog.plugins.views.migrations.V20191203120602_MigrateSavedSearchesToViewsSupport.V20191203120602_MigrateSavedSearchesToViews.MigrationCompleted)11 Test (org.junit.Test)11 AbstractMap (java.util.AbstractMap)10 MongoDBFixtures (org.graylog.testing.mongodb.MongoDBFixtures)10