Search in sources :

Example 6 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 migrateSavedSearchKeywordWithIntervalField.

@Test
@MongoDBFixtures("sample_saved_search_keyword_with_interval_field.json")
public void migrateSavedSearchKeywordWithIntervalField() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660c6b2d44b5813c1d806", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_keyword_with_interval_field-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_keyword_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 7 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 migrateSavedSearchAbsoluteWithIntervalField.

@Test
@MongoDBFixtures("sample_saved_search_absolute_with_interval_field.json")
public void migrateSavedSearchAbsoluteWithIntervalField() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660b7b2d44b5813c1d7f6", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_absolute_with_interval_field-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_absolute_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 8 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 migrateSavedSearchWithAbsoluteTimerange.

@Test
@MongoDBFixtures("sample_saved_search_absolute.json")
public void migrateSavedSearchWithAbsoluteTimerange() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660b7b2d44b5813c1d7f6", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_absolute-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_absolute-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 9 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 migrateSavedSearchWithKeywordTimerange.

@Test
@MongoDBFixtures("sample_saved_search_keyword.json")
public void migrateSavedSearchWithKeywordTimerange() throws Exception {
    this.migration.upgrade();
    final MigrationCompleted migrationCompleted = captureMigrationCompleted();
    assertThat(migrationCompleted.savedSearchIds()).containsExactly(new AbstractMap.SimpleEntry<>("5de660c6b2d44b5813c1d806", "5de0e98900002a0017000002"));
    assertViewServiceCreatedViews(1, resourceFile("sample_saved_search_keyword-expected_views.json"));
    assertSearchServiceCreated(1, resourceFile("sample_saved_search_keyword-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 10 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 migrateSavedSearchWithEmptyFields.

@Test
@MongoDBFixtures("sample_saved_search_with_empty_fields.json")
public void migrateSavedSearchWithEmptyFields() 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)

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