From e77f6eef5b4e0854f7627cf2b56e7818fcab7500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my-Christophe=20Schermesser?= Date: Thu, 15 Feb 2018 13:00:40 +0100 Subject: [PATCH] fix(settings): Rename changeSettings in setSettings (#462) Closes #452 --- .../algolia/definitions/IndexSettingsDefinition.scala | 7 +++++++ src/test/scala/algolia/dsl/IndexSettingsTest.scala | 10 +++++----- .../integration/IndexSettingsIntegrationTest.scala | 4 ++-- .../algolia/integration/SearchIntegrationTest.scala | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/scala/algolia/definitions/IndexSettingsDefinition.scala b/src/main/scala/algolia/definitions/IndexSettingsDefinition.scala index 49242c0c..c1dc5c59 100644 --- a/src/main/scala/algolia/definitions/IndexSettingsDefinition.scala +++ b/src/main/scala/algolia/definitions/IndexSettingsDefinition.scala @@ -102,12 +102,19 @@ trait IndexSettingsDsl { } + @deprecated("use setSettings", "1.27.1") case object changeSettings { def of(index: String) = IndexSettingsDefinition(index) } + case object setSettings { + + def of(index: String) = IndexSettingsDefinition(index) + + } + implicit object IndexSettingsDefinitionExecutable extends Executable[IndexSettingsDefinition, IndexSettings] { override def apply(client: AlgoliaClient, settings: IndexSettingsDefinition)( diff --git a/src/test/scala/algolia/dsl/IndexSettingsTest.scala b/src/test/scala/algolia/dsl/IndexSettingsTest.scala index ac79bf3e..2b477671 100644 --- a/src/test/scala/algolia/dsl/IndexSettingsTest.scala +++ b/src/test/scala/algolia/dsl/IndexSettingsTest.scala @@ -54,11 +54,11 @@ class IndexSettingsTest extends AlgoliaTest { } - describe("change settings") { + describe("set settings") { - it("should get settings") { - changeSettings of "index" `with` IndexSettings() and forwardToSlaves - changeSettings of "index" `with` IndexSettings() and forwardToReplicas + it("should set settings") { + setSettings of "index" `with` IndexSettings() and forwardToSlaves + setSettings of "index" `with` IndexSettings() and forwardToReplicas } it("should call API") { @@ -71,7 +71,7 @@ class IndexSettingsTest extends AlgoliaTest { requestOptions = None ) - (changeSettings of "test" `with` IndexSettings() and forwardToReplicas).build() should be( + (setSettings of "test" `with` IndexSettings() and forwardToReplicas).build() should be( payload) } diff --git a/src/test/scala/algolia/integration/IndexSettingsIntegrationTest.scala b/src/test/scala/algolia/integration/IndexSettingsIntegrationTest.scala index 0b58ac2a..290f06f3 100644 --- a/src/test/scala/algolia/integration/IndexSettingsIntegrationTest.scala +++ b/src/test/scala/algolia/integration/IndexSettingsIntegrationTest.scala @@ -56,9 +56,9 @@ class IndexSettingsIntegrationTest extends AlgoliaTest { } } - it("should update settings") { + it("should set settings") { val change: Future[Task] = client.execute { - changeSettings of "indexToChangeSettings" `with` IndexSettings( + setSettings of "indexToChangeSettings" `with` IndexSettings( searchableAttributes = Some(Seq(SearchableAttributes.attribute("att"))) ) } diff --git a/src/test/scala/algolia/integration/SearchIntegrationTest.scala b/src/test/scala/algolia/integration/SearchIntegrationTest.scala index 8f1e8398..72bb3235 100644 --- a/src/test/scala/algolia/integration/SearchIntegrationTest.scala +++ b/src/test/scala/algolia/integration/SearchIntegrationTest.scala @@ -200,7 +200,7 @@ class SearchIntegrationTest extends AlgoliaTest { it("should search in facets") { val change = client.execute { - changeSettings of "indexToSearchFacet" `with` IndexSettings( + setSettings of "indexToSearchFacet" `with` IndexSettings( attributesForFaceting = Some(Seq("searchable(series)")) ) }