From e78f803659024129626568d40a4c494ee07ed17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Fri, 29 Apr 2022 09:49:10 +0200 Subject: [PATCH 1/2] fix(cts): make tests less verbose --- .../templates/java/generateParams.mustache | 45 +++- .../templates/php/generateParams.mustache | 51 ++-- .../requests/templates/php/requests.mustache | 11 +- .../methods/requests/abtesting.test.java | 23 -- .../methods/requests/analytics.test.java | 94 ------- .../methods/requests/insights.test.java | 46 ---- .../requests/personalization.test.java | 20 -- .../requests/query-suggestions.test.java | 39 --- .../methods/requests/recommend.test.java | 108 -------- .../algolia/methods/requests/search.test.java | 255 ------------------ .../src/methods/requests/AbtestingTest.php | 15 -- .../src/methods/requests/AnalyticsTest.php | 43 --- .../php/src/methods/requests/InsightsTest.php | 27 -- .../methods/requests/PersonalizationTest.php | 16 -- .../methods/requests/QuerySuggestionsTest.php | 24 -- .../src/methods/requests/RecommendTest.php | 62 ----- .../php/src/methods/requests/SearchTest.php | 131 --------- 17 files changed, 63 insertions(+), 947 deletions(-) diff --git a/tests/CTS/methods/requests/templates/java/generateParams.mustache b/tests/CTS/methods/requests/templates/java/generateParams.mustache index f2bc7d9062..60e72b029c 100644 --- a/tests/CTS/methods/requests/templates/java/generateParams.mustache +++ b/tests/CTS/methods/requests/templates/java/generateParams.mustache @@ -1,12 +1,33 @@ -{{#isString}}String {{{key}}}{{suffix}} = "{{{value}}}";{{/isString}} -{{#isInteger}}int {{{key}}}{{suffix}} = {{{value}}};{{/isInteger}} -{{#isLong}}long {{{key}}}{{suffix}} = {{{value}}}L;{{/isLong}} -{{#isDouble}}double {{{key}}}{{suffix}} = {{{value}}};{{/isDouble}} -{{#isBoolean}}boolean {{{key}}}{{suffix}} = {{{value}}};{{/isBoolean}} -{{#isEnum}}{{{objectName}}} {{{key}}}{{suffix}} = {{{objectName}}}.fromValue("{{{value}}}");{{/isEnum}} -{{#isArray}}List{{> generateGenerics}} {{{key}}}{{suffix}} = new ArrayList<>(); { {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.add({{> maybeConvertOneOf}});{{/value}} }{{/isArray}} -{{#isObject}}{{{objectName}}} {{{key}}}{{suffix}} = new {{{objectName}}}(); -{ {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.set{{#lambda.titlecase}}{{{key}}}{{/lambda.titlecase}}({{> maybeConvertOneOf}}); -{{/value}} }{{/isObject}}{{#isFreeFormObject}}Map{{> forceMapGenerics}} {{{key}}}{{suffix}} = new HashMap<>(); -{ {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.put("{{{key}}}", {{> maybeConvertOneOf}}); -{{/value}} }{{/isFreeFormObject}} \ No newline at end of file +{{#isString}} + String {{{key}}}{{suffix}} = "{{{value}}}"; +{{/isString}} +{{#isInteger}} + int {{{key}}}{{suffix}} = {{{value}}}; +{{/isInteger}} +{{#isLong}} + long {{{key}}}{{suffix}} = {{{value}}}L; +{{/isLong}} +{{#isDouble}} + double {{{key}}}{{suffix}} = {{{value}}}; +{{/isDouble}} +{{#isBoolean}} + boolean {{{key}}}{{suffix}} = {{{value}}}; +{{/isBoolean}} +{{#isEnum}} + {{{objectName}}} {{{key}}}{{suffix}} = {{{objectName}}}.fromValue("{{{value}}}"); +{{/isEnum}} +{{#isArray}} + List{{> generateGenerics}} {{{key}}}{{suffix}} = new ArrayList<>(); { {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.add({{> maybeConvertOneOf}});{{/value}} } +{{/isArray}} +{{#isObject}} + {{{objectName}}} {{{key}}}{{suffix}} = new {{{objectName}}}(); + { + {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.set{{#lambda.titlecase}}{{{key}}}{{/lambda.titlecase}}({{> maybeConvertOneOf}});{{/value}} + } +{{/isObject}} +{{#isFreeFormObject}} + Map{{> forceMapGenerics}} {{{key}}}{{suffix}} = new HashMap<>(); + { + {{#value}}{{> generateParams}}{{parent}}{{parentSuffix}}.put("{{{key}}}", {{> maybeConvertOneOf}});{{/value}} + } +{{/isFreeFormObject}} diff --git a/tests/CTS/methods/requests/templates/php/generateParams.mustache b/tests/CTS/methods/requests/templates/php/generateParams.mustache index bc96254a3d..839c2bb2b4 100644 --- a/tests/CTS/methods/requests/templates/php/generateParams.mustache +++ b/tests/CTS/methods/requests/templates/php/generateParams.mustache @@ -1,23 +1,28 @@ -{{#isFirstLevel}}{{#isString}}"{{{value}}}"{{/isString}} -{{#isInteger}}{{{value}}}{{/isInteger}} -{{#isDouble}}{{{value}}}{{/isDouble}} -{{#isLong}}{{{value}}}{{/isLong}} -{{#isBoolean}}{{{value}}}{{/isBoolean}} -{{#isEnum}}"{{{value}}}"{{/isEnum}} -{{#isArray}}[{{#value}}{{> generateParams}}{{/value}}]{{/isArray}} -{{#isObject}}[{{#value}}{{> generateParams}}{{/value}}]{{/isObject}} -{{#isFreeFormObject}}[{{#value}}{{> generateParams}}{{/value}}]{{/isFreeFormObject}} -{{^-last}},{{/-last}} -{{/isFirstLevel}} -{{^isFirstLevel}} -{{^hasGeneratedKey}}"{{{key}}}" => {{/hasGeneratedKey}} -{{#isString}}"{{{value}}}",{{/isString}} -{{#isInteger}}{{{value}}},{{/isInteger}} -{{#isDouble}}{{{value}}},{{/isDouble}} -{{#isLong}}{{{value}}},{{/isLong}} -{{#isBoolean}}{{{value}}},{{/isBoolean}} -{{#isEnum}}"{{{value}}}",{{/isEnum}} -{{#isArray}}[{{#value}}{{> generateParams}}{{/value}}],{{/isArray}} -{{#isObject}}[{{#value}}{{> generateParams}}{{/value}}],{{/isObject}} -{{#isFreeFormObject}}[{{#value}}{{> generateParams}}{{/value}}],{{/isFreeFormObject}} -{{/isFirstLevel}} \ No newline at end of file +{{^isFirstLevel}}{{^hasGeneratedKey}}"{{{key}}}" => {{/hasGeneratedKey}}{{/isFirstLevel}} +{{#isString}} + "{{{value}}}", +{{/isString}} +{{#isEnum}} + "{{{value}}}", +{{/isEnum}} +{{#isInteger}} + {{{value}}}, +{{/isInteger}} +{{#isDouble}} + {{{value}}}, +{{/isDouble}} +{{#isLong}} + {{{value}}}, +{{/isLong}} +{{#isBoolean}} + {{{value}}}, +{{/isBoolean}} +{{#isArray}} + [{{#value}}{{> generateParams}}{{/value}}], +{{/isArray}} +{{#isObject}} + [{{#value}}{{> generateParams}}{{/value}}], +{{/isObject}} +{{#isFreeFormObject}} + [{{#value}}{{> generateParams}}{{/value}}], +{{/isFreeFormObject}} diff --git a/tests/CTS/methods/requests/templates/php/requests.mustache b/tests/CTS/methods/requests/templates/php/requests.mustache index e34c52b637..e8d94974a6 100644 --- a/tests/CTS/methods/requests/templates/php/requests.mustache +++ b/tests/CTS/methods/requests/templates/php/requests.mustache @@ -70,16 +70,9 @@ class {{clientPrefix}}Test extends TestCase implements HttpClientInterface public function test{{#lambda.titlecase}}{{method}}{{/lambda.titlecase}}{{testIndex}}() { $client = $this->getClient(); - - {{#hasParameters}} - - $client->{{{method}}}( + $client->{{^hasParameters}}{{{method}}}();{{/hasParameters}}{{#hasParameters}}{{{method}}}( {{#parametersWithDataType}}{{> generateParams}}{{/parametersWithDataType}} - ); - {{/hasParameters}} - {{^hasParameters}} - $client->{{{method}}}(); - {{/hasParameters}} + );{{/hasParameters}} $this->assertRequests([ [ diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java index b4562db194..91bf6d8081 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/abtesting.test.java @@ -33,34 +33,24 @@ void addABTestsTest0() { AddABTestsRequest addABTestsRequest0 = new AddABTestsRequest(); { String endAt1 = "2022-12-31T00:00:00.000Z"; - addABTestsRequest0.setEndAt(endAt1); String name1 = "myABTest"; - addABTestsRequest0.setName(name1); - List variant1 = new ArrayList<>(); { AbTestsVariant variant_02 = new AbTestsVariant(); { String index3 = "AB_TEST_1"; - variant_02.setIndex(index3); - int trafficPercentage3 = 30; - variant_02.setTrafficPercentage(trafficPercentage3); } variant1.add(AddABTestsVariant.ofAbTestsVariant(variant_02)); - AbTestsVariant variant_12 = new AbTestsVariant(); { String index3 = "AB_TEST_2"; - variant_12.setIndex(index3); - int trafficPercentage3 = 50; - variant_12.setTrafficPercentage(trafficPercentage3); } variant1.add(AddABTestsVariant.ofAbTestsVariant(variant_12)); @@ -103,11 +93,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -162,11 +150,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -207,7 +193,6 @@ void getABTestTest0() { @DisplayName("listABTests with minimal parameters") void listABTestsTest0() { int offset0 = 42; - int limit0 = 21; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -247,18 +232,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -307,18 +288,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java index bd347f836e..e1f1e7e6c5 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/analytics.test.java @@ -45,11 +45,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -90,11 +88,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -145,11 +141,8 @@ void getAverageClickPositionTest0() { @DisplayName("get getAverageClickPosition with all parameters") void getAverageClickPositionTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -204,11 +197,8 @@ void getClickPositionsTest0() { @DisplayName("get getClickPositions with all parameters") void getClickPositionsTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -258,11 +248,8 @@ void getClickThroughRateTest0() { @DisplayName("get getClickThroughRate with all parameters") void getClickThroughRateTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -312,11 +299,8 @@ void getConversationRateTest0() { @DisplayName("get getConversationRate with all parameters") void getConversationRateTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -366,11 +350,8 @@ void getNoClickRateTest0() { @DisplayName("get getNoClickRate with all parameters") void getNoClickRateTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -420,11 +401,8 @@ void getNoResultsRateTest0() { @DisplayName("get getNoResultsRate with all parameters") void getNoResultsRateTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -474,11 +452,8 @@ void getSearchesCountTest0() { @DisplayName("get getSearchesCount with all parameters") void getSearchesCountTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -528,15 +503,10 @@ void getSearchesNoClicksTest0() { @DisplayName("get getSearchesNoClicks with all parameters") void getSearchesNoClicksTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -593,15 +563,10 @@ void getSearchesNoResultsTest0() { @DisplayName("get getSearchesNoResults with all parameters") void getSearchesNoResultsTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -682,15 +647,10 @@ void getTopCountriesTest0() { @DisplayName("get getTopCountries with all parameters") void getTopCountriesTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -747,17 +707,11 @@ void getTopFilterAttributesTest0() { @DisplayName("get getTopFilterAttributes with all parameters") void getTopFilterAttributesTest1() { String index0 = "index"; - String search0 = "mySearch"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -791,7 +745,6 @@ void getTopFilterAttributesTest1() { @DisplayName("get getTopFilterForAttribute with minimal parameters") void getTopFilterForAttributeTest0() { String attribute0 = "myAttribute"; - String index0 = "index"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -819,7 +772,6 @@ void getTopFilterForAttributeTest0() { ) void getTopFilterForAttributeTest1() { String attribute0 = "myAttribute1,myAttribute2"; - String index0 = "index"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -845,19 +797,12 @@ void getTopFilterForAttributeTest1() { @DisplayName("get getTopFilterForAttribute with all parameters") void getTopFilterForAttributeTest2() { String attribute0 = "myAttribute"; - String index0 = "index"; - String search0 = "mySearch"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -894,19 +839,12 @@ void getTopFilterForAttributeTest2() { ) void getTopFilterForAttributeTest3() { String attribute0 = "myAttribute1,myAttribute2"; - String index0 = "index"; - String search0 = "mySearch"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -965,17 +903,11 @@ void getTopFiltersNoResultsTest0() { @DisplayName("get getTopFiltersNoResults with all parameters") void getTopFiltersNoResultsTest1() { String index0 = "index"; - String search0 = "mySearch"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1033,19 +965,12 @@ void getTopHitsTest0() { @DisplayName("get getTopHits with all parameters") void getTopHitsTest1() { String index0 = "index"; - String search0 = "mySearch"; - boolean clickAnalytics0 = true; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1104,21 +1029,13 @@ void getTopSearchesTest0() { @DisplayName("get getTopSearches with all parameters") void getTopSearchesTest1() { String index0 = "index"; - boolean clickAnalytics0 = true; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - OrderBy orderBy0 = OrderBy.fromValue("searchCount"); - Direction direction0 = Direction.fromValue("asc"); - int limit0 = 21; - int offset0 = 42; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1178,11 +1095,8 @@ void getUsersCountTest0() { @DisplayName("get getUsersCount with all parameters") void getUsersCountTest1() { String index0 = "index"; - String startDate0 = "1999-09-19"; - String endDate0 = "2001-01-01"; - String tags0 = "tag"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1222,18 +1136,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -1282,18 +1192,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java index e705bb0665..676f86d305 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/insights.test.java @@ -45,11 +45,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -90,11 +88,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -135,18 +131,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -187,112 +179,78 @@ void pushEventsTest0() { InsightEvent events_02 = new InsightEvent(); { EventType eventType3 = EventType.fromValue("click"); - events_02.setEventType(eventType3); String eventName3 = "Product Clicked"; - events_02.setEventName(eventName3); String index3 = "products"; - events_02.setIndex(index3); String userToken3 = "user-123456"; - events_02.setUserToken(userToken3); - long timestamp3 = 1641290601962L; - events_02.setTimestamp(timestamp3); - List objectIDs3 = new ArrayList<>(); { String objectIDs_04 = "9780545139700"; - objectIDs3.add(objectIDs_04); String objectIDs_14 = "9780439784542"; - objectIDs3.add(objectIDs_14); } events_02.setObjectIDs(objectIDs3); String queryID3 = "43b15df305339e827f0ac0bdc5ebcaa7"; - events_02.setQueryID(queryID3); - List positions3 = new ArrayList<>(); { int positions_04 = 7; - positions3.add(positions_04); int positions_14 = 6; - positions3.add(positions_14); } events_02.setPositions(positions3); } events1.add(events_02); - InsightEvent events_12 = new InsightEvent(); { EventType eventType3 = EventType.fromValue("view"); - events_12.setEventType(eventType3); String eventName3 = "Product Detail Page Viewed"; - events_12.setEventName(eventName3); String index3 = "products"; - events_12.setIndex(index3); String userToken3 = "user-123456"; - events_12.setUserToken(userToken3); - long timestamp3 = 1641290601962L; - events_12.setTimestamp(timestamp3); - List objectIDs3 = new ArrayList<>(); { String objectIDs_04 = "9780545139700"; - objectIDs3.add(objectIDs_04); String objectIDs_14 = "9780439784542"; - objectIDs3.add(objectIDs_14); } events_12.setObjectIDs(objectIDs3); } events1.add(events_12); - InsightEvent events_22 = new InsightEvent(); { EventType eventType3 = EventType.fromValue("conversion"); - events_22.setEventType(eventType3); String eventName3 = "Product Purchased"; - events_22.setEventName(eventName3); String index3 = "products"; - events_22.setIndex(index3); String userToken3 = "user-123456"; - events_22.setUserToken(userToken3); - long timestamp3 = 1641290601962L; - events_22.setTimestamp(timestamp3); - List objectIDs3 = new ArrayList<>(); { String objectIDs_04 = "9780545139700"; - objectIDs3.add(objectIDs_04); String objectIDs_14 = "9780439784542"; - objectIDs3.add(objectIDs_14); } events_22.setObjectIDs(objectIDs3); String queryID3 = "43b15df305339e827f0ac0bdc5ebcaa7"; - events_22.setQueryID(queryID3); } events1.add(events_22); @@ -339,18 +297,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java index 47885c9bec..aa531ea904 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/personalization.test.java @@ -45,11 +45,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -104,11 +102,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -175,18 +171,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -235,18 +227,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -287,36 +275,28 @@ void setPersonalizationStrategyTest0() { EventScoring eventScoring_02 = new EventScoring(); { int score3 = 42; - eventScoring_02.setScore(score3); String eventName3 = "Algolia"; - eventScoring_02.setEventName(eventName3); String eventType3 = "Event"; - eventScoring_02.setEventType(eventType3); } eventScoring1.add(eventScoring_02); } personalizationStrategyParams0.setEventScoring(eventScoring1); - List facetScoring1 = new ArrayList<>(); { FacetScoring facetScoring_02 = new FacetScoring(); { int score3 = 42; - facetScoring_02.setScore(score3); String facetName3 = "Event"; - facetScoring_02.setFacetName(facetName3); } facetScoring1.add(facetScoring_02); } personalizationStrategyParams0.setFacetScoring(facetScoring1); - int personalizationImpact1 = 42; - personalizationStrategyParams0.setPersonalizationImpact( personalizationImpact1 ); diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java index fecd145908..ccda89787a 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/query-suggestions.test.java @@ -33,46 +33,36 @@ void createConfigTest0() { QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam0 = new QuerySuggestionsIndexWithIndexParam(); { String indexName1 = "theIndexName"; - querySuggestionsIndexWithIndexParam0.setIndexName(indexName1); - List sourceIndices1 = new ArrayList<>(); { SourceIndex sourceIndices_02 = new SourceIndex(); { String indexName3 = "testIndex"; - sourceIndices_02.setIndexName(indexName3); - List facets3 = new ArrayList<>(); { Map facets_04 = new HashMap<>(); { String attributes5 = "test"; - facets_04.put("attributes", attributes5); } facets3.add(facets_04); } sourceIndices_02.setFacets(facets3); - List> generate3 = new ArrayList<>(); { List generate_04 = new ArrayList<>(); { String generate_0_05 = "facetA"; - generate_04.add(generate_0_05); String generate_0_15 = "facetB"; - generate_04.add(generate_0_15); } generate3.add(generate_04); - List generate_14 = new ArrayList<>(); { String generate_1_05 = "facetC"; - generate_14.add(generate_1_05); } generate3.add(generate_14); @@ -82,19 +72,15 @@ void createConfigTest0() { sourceIndices1.add(sourceIndices_02); } querySuggestionsIndexWithIndexParam0.setSourceIndices(sourceIndices1); - List languages1 = new ArrayList<>(); { String languages_02 = "french"; - languages1.add(languages_02); } querySuggestionsIndexWithIndexParam0.setLanguages(languages1); - List exclude1 = new ArrayList<>(); { String exclude_02 = "test"; - exclude1.add(exclude_02); } querySuggestionsIndexWithIndexParam0.setExclude(exclude1); @@ -135,11 +121,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -194,11 +178,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -293,18 +275,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -353,18 +331,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -399,7 +373,6 @@ void putTest1() { @DisplayName("updateConfig") void updateConfigTest0() { String indexName0 = "theIndexName"; - QuerySuggestionsIndexParam querySuggestionsIndexParam0 = new QuerySuggestionsIndexParam(); { List sourceIndices1 = new ArrayList<>(); @@ -407,38 +380,30 @@ void updateConfigTest0() { SourceIndex sourceIndices_02 = new SourceIndex(); { String indexName3 = "testIndex"; - sourceIndices_02.setIndexName(indexName3); - List facets3 = new ArrayList<>(); { Map facets_04 = new HashMap<>(); { String attributes5 = "test"; - facets_04.put("attributes", attributes5); } facets3.add(facets_04); } sourceIndices_02.setFacets(facets3); - List> generate3 = new ArrayList<>(); { List generate_04 = new ArrayList<>(); { String generate_0_05 = "facetA"; - generate_04.add(generate_0_05); String generate_0_15 = "facetB"; - generate_04.add(generate_0_15); } generate3.add(generate_04); - List generate_14 = new ArrayList<>(); { String generate_1_05 = "facetC"; - generate_14.add(generate_1_05); } generate3.add(generate_14); @@ -448,19 +413,15 @@ void updateConfigTest0() { sourceIndices1.add(sourceIndices_02); } querySuggestionsIndexParam0.setSourceIndices(sourceIndices1); - List languages1 = new ArrayList<>(); { String languages_02 = "french"; - languages1.add(languages_02); } querySuggestionsIndexParam0.setLanguages(languages1); - List exclude1 = new ArrayList<>(); { String exclude_02 = "test"; - exclude1.add(exclude_02); } querySuggestionsIndexParam0.setExclude(exclude1); diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java index 5bfb958b41..7c011201f3 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/recommend.test.java @@ -45,11 +45,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -90,11 +88,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -129,20 +125,14 @@ void getRecommendationsTest0() { RecommendationRequest requests_02 = new RecommendationRequest(); { String indexName3 = "indexName"; - requests_02.setIndexName(indexName3); String objectID3 = "objectID"; - requests_02.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_02.setModel(model3); - int threshold3 = 42; - requests_02.setThreshold(threshold3); } requests1.add( @@ -179,36 +169,24 @@ void getRecommendationsTest1() { RecommendationRequest requests_02 = new RecommendationRequest(); { String indexName3 = "indexName"; - requests_02.setIndexName(indexName3); String objectID3 = "objectID"; - requests_02.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_02.setModel(model3); - int threshold3 = 42; - requests_02.setThreshold(threshold3); - int maxRecommendations3 = 10; - requests_02.setMaxRecommendations(maxRecommendations3); - SearchParamsObject queryParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - queryParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "query"; - facetFilters4.add(facetFilters_05); } queryParameters3.setFacetFilters( @@ -216,17 +194,13 @@ void getRecommendationsTest1() { ); } requests_02.setQueryParameters(queryParameters3); - SearchParamsObject fallbackParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - fallbackParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "fallback"; - facetFilters4.add(facetFilters_05); } fallbackParameters3.setFacetFilters( @@ -269,15 +243,10 @@ void getRecommendationsTest2() { TrendingRequest requests_02 = new TrendingRequest(); { String indexName3 = "indexName"; - requests_02.setIndexName(indexName3); - TrendingModels model3 = TrendingModels.fromValue("trending-items"); - requests_02.setModel(model3); - int threshold3 = 42; - requests_02.setThreshold(threshold3); } requests1.add(RecommendationsRequest.ofTrendingRequest(requests_02)); @@ -312,37 +281,24 @@ void getRecommendationsTest3() { TrendingRequest requests_02 = new TrendingRequest(); { String indexName3 = "indexName"; - requests_02.setIndexName(indexName3); - TrendingModels model3 = TrendingModels.fromValue("trending-items"); - requests_02.setModel(model3); - int threshold3 = 42; - requests_02.setThreshold(threshold3); - int maxRecommendations3 = 10; - requests_02.setMaxRecommendations(maxRecommendations3); String facetName3 = "myFacetName"; - requests_02.setFacetName(facetName3); String facetValue3 = "myFacetValue"; - requests_02.setFacetValue(facetValue3); - SearchParamsObject queryParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - queryParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "query"; - facetFilters4.add(facetFilters_05); } queryParameters3.setFacetFilters( @@ -350,17 +306,13 @@ void getRecommendationsTest3() { ); } requests_02.setQueryParameters(queryParameters3); - SearchParamsObject fallbackParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - fallbackParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "fallback"; - facetFilters4.add(facetFilters_05); } fallbackParameters3.setFacetFilters( @@ -401,43 +353,30 @@ void getRecommendationsTest4() { RecommendationRequest requests_02 = new RecommendationRequest(); { String indexName3 = "indexName1"; - requests_02.setIndexName(indexName3); String objectID3 = "objectID1"; - requests_02.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_02.setModel(model3); - int threshold3 = 21; - requests_02.setThreshold(threshold3); } requests1.add( RecommendationsRequest.ofRecommendationRequest(requests_02) ); - RecommendationRequest requests_12 = new RecommendationRequest(); { String indexName3 = "indexName2"; - requests_12.setIndexName(indexName3); String objectID3 = "objectID2"; - requests_12.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_12.setModel(model3); - int threshold3 = 21; - requests_12.setThreshold(threshold3); } requests1.add( @@ -474,36 +413,24 @@ void getRecommendationsTest5() { RecommendationRequest requests_02 = new RecommendationRequest(); { String indexName3 = "indexName1"; - requests_02.setIndexName(indexName3); String objectID3 = "objectID1"; - requests_02.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_02.setModel(model3); - int threshold3 = 21; - requests_02.setThreshold(threshold3); - int maxRecommendations3 = 10; - requests_02.setMaxRecommendations(maxRecommendations3); - SearchParamsObject queryParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - queryParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "query1"; - facetFilters4.add(facetFilters_05); } queryParameters3.setFacetFilters( @@ -511,17 +438,13 @@ void getRecommendationsTest5() { ); } requests_02.setQueryParameters(queryParameters3); - SearchParamsObject fallbackParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - fallbackParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "fallback1"; - facetFilters4.add(facetFilters_05); } fallbackParameters3.setFacetFilters( @@ -533,40 +456,27 @@ void getRecommendationsTest5() { requests1.add( RecommendationsRequest.ofRecommendationRequest(requests_02) ); - RecommendationRequest requests_12 = new RecommendationRequest(); { String indexName3 = "indexName2"; - requests_12.setIndexName(indexName3); String objectID3 = "objectID2"; - requests_12.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "related-products" ); - requests_12.setModel(model3); - int threshold3 = 21; - requests_12.setThreshold(threshold3); - int maxRecommendations3 = 10; - requests_12.setMaxRecommendations(maxRecommendations3); - SearchParamsObject queryParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - queryParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "query2"; - facetFilters4.add(facetFilters_05); } queryParameters3.setFacetFilters( @@ -574,17 +484,13 @@ void getRecommendationsTest5() { ); } requests_12.setQueryParameters(queryParameters3); - SearchParamsObject fallbackParameters3 = new SearchParamsObject(); { String query4 = "myQuery"; - fallbackParameters3.setQuery(query4); - List facetFilters4 = new ArrayList<>(); { String facetFilters_05 = "fallback2"; - facetFilters4.add(facetFilters_05); } fallbackParameters3.setFacetFilters( @@ -627,20 +533,14 @@ void getRecommendationsTest6() { RecommendationRequest requests_02 = new RecommendationRequest(); { String indexName3 = "indexName1"; - requests_02.setIndexName(indexName3); String objectID3 = "objectID1"; - requests_02.setObjectID(objectID3); - RecommendationModels model3 = RecommendationModels.fromValue( "bought-together" ); - requests_02.setModel(model3); - int threshold3 = 42; - requests_02.setThreshold(threshold3); } requests1.add( @@ -685,18 +585,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -745,18 +641,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java index d2eb69ddc8..12f276ddc3 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java @@ -35,28 +35,18 @@ void addApiKeyTest0() { List acl1 = new ArrayList<>(); { Acl acl_02 = Acl.fromValue("search"); - acl1.add(acl_02); - Acl acl_12 = Acl.fromValue("addObject"); - acl1.add(acl_12); } apiKey0.setAcl(acl1); String description1 = "my new api key"; - apiKey0.setDescription(description1); - int validity1 = 300; - apiKey0.setValidity(validity1); - int maxQueriesPerIPPerHour1 = 100; - apiKey0.setMaxQueriesPerIPPerHour(maxQueriesPerIPPerHour1); - int maxHitsPerQuery1 = 20; - apiKey0.setMaxHitsPerQuery(maxHitsPerQuery1); } @@ -82,13 +72,10 @@ void addApiKeyTest0() { @DisplayName("addOrUpdateObject") void addOrUpdateObjectTest0() { String indexName0 = "indexName"; - String objectID0 = "uniqueID"; - Map body0 = new HashMap<>(); { String key1 = "value"; - body0.put("key", key1); } @@ -115,10 +102,8 @@ void appendSourceTest0() { Source source0 = new Source(); { String source1 = "theSource"; - source0.setSource(source1); String description1 = "theDescription"; - source0.setDescription(description1); } @@ -143,11 +128,9 @@ void appendSourceTest0() { @DisplayName("assignUserId") void assignUserIdTest0() { String xAlgoliaUserID0 = "userID"; - AssignUserIdParams assignUserIdParams0 = new AssignUserIdParams(); { String cluster1 = "theCluster"; - assignUserIdParams0.setCluster(cluster1); } @@ -182,7 +165,6 @@ void assignUserIdTest0() { @DisplayName("batch") void batchTest0() { String indexName0 = "theIndexName"; - BatchWriteParams batchWriteParams0 = new BatchWriteParams(); { List requests1 = new ArrayList<>(); @@ -190,13 +172,10 @@ void batchTest0() { BatchOperation requests_02 = new BatchOperation(); { Action action3 = Action.fromValue("delete"); - requests_02.setAction(action3); - Map body3 = new HashMap<>(); { String key4 = "value"; - body3.put("key", key4); } requests_02.setBody(body3); @@ -227,20 +206,15 @@ void batchTest0() { @DisplayName("batchAssignUserIds") void batchAssignUserIdsTest0() { String xAlgoliaUserID0 = "userID"; - BatchAssignUserIdsParams batchAssignUserIdsParams0 = new BatchAssignUserIdsParams(); { String cluster1 = "theCluster"; - batchAssignUserIdsParams0.setCluster(cluster1); - List users1 = new ArrayList<>(); { String users_02 = "user1"; - users1.add(users_02); String users_12 = "user2"; - users1.add(users_12); } batchAssignUserIdsParams0.setUsers(users1); @@ -280,7 +254,6 @@ void batchAssignUserIdsTest0() { @DisplayName("get batchDictionaryEntries results with minimal parameters") void batchDictionaryEntriesTest0() { DictionaryType dictionaryName0 = DictionaryType.fromValue("compounds"); - BatchDictionaryEntriesParams batchDictionaryEntriesParams0 = new BatchDictionaryEntriesParams(); { List requests1 = new ArrayList<>(); @@ -288,35 +261,26 @@ void batchDictionaryEntriesTest0() { BatchDictionaryEntriesRequest requests_02 = new BatchDictionaryEntriesRequest(); { DictionaryAction action3 = DictionaryAction.fromValue("addEntry"); - requests_02.setAction(action3); - DictionaryEntry body3 = new DictionaryEntry(); { String objectID4 = "1"; - body3.setObjectID(objectID4); String language4 = "en"; - body3.setLanguage(language4); } requests_02.setBody(body3); } requests1.add(requests_02); - BatchDictionaryEntriesRequest requests_12 = new BatchDictionaryEntriesRequest(); { DictionaryAction action3 = DictionaryAction.fromValue("deleteEntry"); - requests_12.setAction(action3); - DictionaryEntry body3 = new DictionaryEntry(); { String objectID4 = "2"; - body3.setObjectID(objectID4); String language4 = "fr"; - body3.setLanguage(language4); } requests_12.setBody(body3); @@ -350,111 +314,81 @@ void batchDictionaryEntriesTest0() { @DisplayName("get batchDictionaryEntries results with all parameters") void batchDictionaryEntriesTest1() { DictionaryType dictionaryName0 = DictionaryType.fromValue("compounds"); - BatchDictionaryEntriesParams batchDictionaryEntriesParams0 = new BatchDictionaryEntriesParams(); { boolean clearExistingDictionaryEntries1 = false; - batchDictionaryEntriesParams0.setClearExistingDictionaryEntries( clearExistingDictionaryEntries1 ); - List requests1 = new ArrayList<>(); { BatchDictionaryEntriesRequest requests_02 = new BatchDictionaryEntriesRequest(); { DictionaryAction action3 = DictionaryAction.fromValue("addEntry"); - requests_02.setAction(action3); - DictionaryEntry body3 = new DictionaryEntry(); { String objectID4 = "1"; - body3.setObjectID(objectID4); String language4 = "en"; - body3.setLanguage(language4); String word4 = "fancy"; - body3.setWord(word4); - List words4 = new ArrayList<>(); { String words_05 = "believe"; - words4.add(words_05); String words_15 = "algolia"; - words4.add(words_15); } body3.setWords(words4); - List decomposition4 = new ArrayList<>(); { String decomposition_05 = "trust"; - decomposition4.add(decomposition_05); String decomposition_15 = "algolia"; - decomposition4.add(decomposition_15); } body3.setDecomposition(decomposition4); - DictionaryEntryState state4 = DictionaryEntryState.fromValue( "enabled" ); - body3.setState(state4); } requests_02.setBody(body3); } requests1.add(requests_02); - BatchDictionaryEntriesRequest requests_12 = new BatchDictionaryEntriesRequest(); { DictionaryAction action3 = DictionaryAction.fromValue("deleteEntry"); - requests_12.setAction(action3); - DictionaryEntry body3 = new DictionaryEntry(); { String objectID4 = "2"; - body3.setObjectID(objectID4); String language4 = "fr"; - body3.setLanguage(language4); String word4 = "humility"; - body3.setWord(word4); - List words4 = new ArrayList<>(); { String words_05 = "candor"; - words4.add(words_05); String words_15 = "algolia"; - words4.add(words_15); } body3.setWords(words4); - List decomposition4 = new ArrayList<>(); { String decomposition_05 = "grit"; - decomposition4.add(decomposition_05); String decomposition_15 = "algolia"; - decomposition4.add(decomposition_15); } body3.setDecomposition(decomposition4); - DictionaryEntryState state4 = DictionaryEntryState.fromValue( "enabled" ); - body3.setState(state4); } requests_12.setBody(body3); @@ -488,37 +422,29 @@ void batchDictionaryEntriesTest1() { @DisplayName("batchRules") void batchRulesTest0() { String indexName0 = "indexName"; - List rule0 = new ArrayList<>(); { Rule rule_01 = new Rule(); { String objectID2 = "a-rule-id"; - rule_01.setObjectID(objectID2); - List conditions2 = new ArrayList<>(); { Condition conditions_03 = new Condition(); { String pattern4 = "smartphone"; - conditions_03.setPattern(pattern4); - Anchoring anchoring4 = Anchoring.fromValue("contains"); - conditions_03.setAnchoring(anchoring4); } conditions2.add(conditions_03); } rule_01.setConditions(conditions2); - Consequence consequence2 = new Consequence(); { ConsequenceParams params3 = new ConsequenceParams(); { String filters4 = "category:smartphone"; - params3.setFilters(filters4); } consequence2.setParams(params3); @@ -526,35 +452,27 @@ void batchRulesTest0() { rule_01.setConsequence(consequence2); } rule0.add(rule_01); - Rule rule_11 = new Rule(); { String objectID2 = "a-second-rule-id"; - rule_11.setObjectID(objectID2); - List conditions2 = new ArrayList<>(); { Condition conditions_03 = new Condition(); { String pattern4 = "apple"; - conditions_03.setPattern(pattern4); - Anchoring anchoring4 = Anchoring.fromValue("contains"); - conditions_03.setAnchoring(anchoring4); } conditions2.add(conditions_03); } rule_11.setConditions(conditions2); - Consequence consequence2 = new Consequence(); { ConsequenceParams params3 = new ConsequenceParams(); { String filters4 = "brand:apple"; - params3.setFilters(filters4); } consequence2.setParams(params3); @@ -563,9 +481,7 @@ void batchRulesTest0() { } rule0.add(rule_11); } - boolean forwardToReplicas0 = true; - boolean clearExistingRules0 = true; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -618,14 +534,11 @@ void browseTest0() { @DisplayName("get browse results with all parameters") void browseTest1() { String indexName0 = "indexName"; - BrowseRequest browseRequest0 = new BrowseRequest(); { String params1 = "query=foo&facetFilters=['bar']"; - browseRequest0.setParams(params1); String cursor1 = "cts"; - browseRequest0.setCursor(cursor1); } @@ -706,11 +619,9 @@ void delTest0() { @DisplayName("allow del method for a custom path with all parameters") void delTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -751,11 +662,9 @@ void deleteApiKeyTest0() { @DisplayName("deleteBy") void deleteByTest0() { String indexName0 = "theIndexName"; - SearchParamsObject searchParams0 = new SearchParamsObject(); { String query1 = "testQuery"; - searchParams0.setQuery(query1); } @@ -797,7 +706,6 @@ void deleteIndexTest0() { @DisplayName("deleteObject") void deleteObjectTest0() { String indexName0 = "theIndexName"; - String objectID0 = "uniqueID"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -813,7 +721,6 @@ void deleteObjectTest0() { @DisplayName("deleteRule") void deleteRuleTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -843,7 +750,6 @@ void deleteSourceTest0() { @DisplayName("deleteSynonym") void deleteSynonymTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -873,11 +779,9 @@ void getTest0() { @DisplayName("allow get method for a custom path with all parameters") void getTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } @@ -942,11 +846,8 @@ void getDictionarySettingsTest0() { @DisplayName("getLogs") void getLogsTest0() { int offset0 = 5; - int length0 = 10; - String indexName0 = "theIndexName"; - LogType type0 = LogType.fromValue("all"); EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -972,16 +873,12 @@ void getLogsTest0() { @DisplayName("getObject") void getObjectTest0() { String indexName0 = "theIndexName"; - String objectID0 = "uniqueID"; - List attributesToRetrieve0 = new ArrayList<>(); { String attributesToRetrieve_01 = "attr1"; - attributesToRetrieve0.add(attributesToRetrieve_01); String attributesToRetrieve_11 = "attr2"; - attributesToRetrieve0.add(attributesToRetrieve_11); } @@ -1016,18 +913,14 @@ void getObjectsTest0() { List attributesToRetrieve3 = new ArrayList<>(); { String attributesToRetrieve_04 = "attr1"; - attributesToRetrieve3.add(attributesToRetrieve_04); String attributesToRetrieve_14 = "attr2"; - attributesToRetrieve3.add(attributesToRetrieve_14); } requests_02.setAttributesToRetrieve(attributesToRetrieve3); String objectID3 = "uniqueID"; - requests_02.setObjectID(objectID3); String indexName3 = "theIndexName"; - requests_02.setIndexName(indexName3); } requests1.add(requests_02); @@ -1056,7 +949,6 @@ void getObjectsTest0() { @DisplayName("getRule") void getRuleTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1098,7 +990,6 @@ void getSourcesTest0() { @DisplayName("getSynonym") void getSynonymTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1114,7 +1005,6 @@ void getSynonymTest0() { @DisplayName("getTask") void getTaskTest0() { String indexName0 = "theIndexName"; - int taskID0 = 123; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1228,7 +1118,6 @@ void listIndicesTest0() { @DisplayName("listUserIds") void listUserIdsTest0() { int page0 = 8; - int hitsPerPage0 = 100; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1260,18 +1149,14 @@ void multipleBatchTest0() { MultipleBatchOperation requests_02 = new MultipleBatchOperation(); { Action action3 = Action.fromValue("addObject"); - requests_02.setAction(action3); - Map body3 = new HashMap<>(); { String key4 = "value"; - body3.put("key", key4); } requests_02.setBody(body3); String indexName3 = "theIndexName"; - requests_02.setIndexName(indexName3); } requests1.add(requests_02); @@ -1306,17 +1191,14 @@ void multipleQueriesTest0() { MultipleQueries requests_02 = new MultipleQueries(); { String indexName3 = "theIndexName"; - requests_02.setIndexName(indexName3); } requests1.add(requests_02); } multipleQueriesParams0.setRequests(requests1); - MultipleQueriesStrategy strategy1 = MultipleQueriesStrategy.fromValue( "stopIfEnoughMatches" ); - multipleQueriesParams0.setStrategy(strategy1); } @@ -1347,48 +1229,34 @@ void multipleQueriesTest1() { MultipleQueries requests_02 = new MultipleQueries(); { String indexName3 = "theIndexName"; - requests_02.setIndexName(indexName3); String query3 = "test"; - requests_02.setQuery(query3); - MultipleQueriesType type3 = MultipleQueriesType.fromValue("facet"); - requests_02.setType(type3); String facet3 = "theFacet"; - requests_02.setFacet(facet3); String params3 = "testParam"; - requests_02.setParams(params3); } requests1.add(requests_02); - MultipleQueries requests_12 = new MultipleQueries(); { String indexName3 = "theIndexName"; - requests_12.setIndexName(indexName3); String query3 = "test"; - requests_12.setQuery(query3); - MultipleQueriesType type3 = MultipleQueriesType.fromValue("default"); - requests_12.setType(type3); String params3 = "testParam"; - requests_12.setParams(params3); } requests1.add(requests_12); } multipleQueriesParams0.setRequests(requests1); - MultipleQueriesStrategy strategy1 = MultipleQueriesStrategy.fromValue( "stopIfEnoughMatches" ); - multipleQueriesParams0.setStrategy(strategy1); } @@ -1413,24 +1281,17 @@ void multipleQueriesTest1() { @DisplayName("operationIndex") void operationIndexTest0() { String indexName0 = "theIndexName"; - OperationIndexParams operationIndexParams0 = new OperationIndexParams(); { OperationType operation1 = OperationType.fromValue("copy"); - operationIndexParams0.setOperation(operation1); String destination1 = "dest"; - operationIndexParams0.setDestination(destination1); - List scope1 = new ArrayList<>(); { ScopeType scope_02 = ScopeType.fromValue("rules"); - scope1.add(scope_02); - ScopeType scope_12 = ScopeType.fromValue("settings"); - scope1.add(scope_12); } operationIndexParams0.setScope(scope1); @@ -1457,29 +1318,23 @@ void operationIndexTest0() { @DisplayName("partialUpdateObject") void partialUpdateObjectTest0() { String indexName0 = "theIndexName"; - String objectID0 = "uniqueID"; - List> attributeOrBuiltInOperation0 = new ArrayList<>(); { Map attributeOrBuiltInOperation_01 = new HashMap<>(); { String id12 = "test"; - attributeOrBuiltInOperation_01.put( "id1", AttributeOrBuiltInOperation.ofString(id12) ); - BuiltInOperation id22 = new BuiltInOperation(); { BuiltInOperationType operation3 = BuiltInOperationType.fromValue( "AddUnique" ); - id22.setOperation(operation3); String value3 = "test2"; - id22.setValue(value3); } attributeOrBuiltInOperation_01.put( @@ -1489,7 +1344,6 @@ void partialUpdateObjectTest0() { } attributeOrBuiltInOperation0.add(attributeOrBuiltInOperation_01); } - boolean createIfNotExists0 = true; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1542,18 +1396,14 @@ void postTest0() { @DisplayName("allow post method for a custom path with all parameters") void postTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -1602,18 +1452,14 @@ void putTest0() { @DisplayName("allow put method for a custom path with all parameters") void putTest1() { String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); { String query1 = "parameters"; - parameters0.put("query", query1); } - Map body0 = new HashMap<>(); { String body1 = "parameters"; - body0.put("body", body1); } @@ -1666,10 +1512,8 @@ void replaceSourcesTest0() { Source source_01 = new Source(); { String source2 = "theSource"; - source_01.setSource(source2); String description2 = "theDescription"; - source_01.setDescription(description2); } source0.add(source_01); @@ -1710,14 +1554,11 @@ void restoreApiKeyTest0() { @DisplayName("saveObject") void saveObjectTest0() { String indexName0 = "theIndexName"; - Map body0 = new HashMap<>(); { String objectID1 = "id"; - body0.put("objectID", objectID1); String test1 = "val"; - body0.put("test", test1); } @@ -1742,44 +1583,34 @@ void saveObjectTest0() { @DisplayName("saveRule") void saveRuleTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; - Rule rule0 = new Rule(); { String objectID1 = "id1"; - rule0.setObjectID(objectID1); - List conditions1 = new ArrayList<>(); { Condition conditions_02 = new Condition(); { String pattern3 = "apple"; - conditions_02.setPattern(pattern3); - Anchoring anchoring3 = Anchoring.fromValue("contains"); - conditions_02.setAnchoring(anchoring3); } conditions1.add(conditions_02); } rule0.setConditions(conditions1); - Consequence consequence1 = new Consequence(); { ConsequenceParams params2 = new ConsequenceParams(); { String filters3 = "brand:apple"; - params2.setFilters(filters3); } consequence1.setParams(params2); } rule0.setConsequence(consequence1); } - boolean forwardToReplicas0 = true; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1818,34 +1649,24 @@ void saveRuleTest0() { @DisplayName("saveSynonym") void saveSynonymTest0() { String indexName0 = "indexName"; - String objectID0 = "id1"; - SynonymHit synonymHit0 = new SynonymHit(); { String objectID1 = "id1"; - synonymHit0.setObjectID(objectID1); - SynonymType type1 = SynonymType.fromValue("synonym"); - synonymHit0.setType(type1); - List synonyms1 = new ArrayList<>(); { String synonyms_02 = "car"; - synonyms1.add(synonyms_02); String synonyms_12 = "vehicule"; - synonyms1.add(synonyms_12); String synonyms_22 = "auto"; - synonyms1.add(synonyms_22); } synonymHit0.setSynonyms(synonyms1); } - boolean forwardToReplicas0 = true; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1884,67 +1705,48 @@ void saveSynonymTest0() { @DisplayName("saveSynonyms") void saveSynonymsTest0() { String indexName0 = "indexName"; - List synonymHit0 = new ArrayList<>(); { SynonymHit synonymHit_01 = new SynonymHit(); { String objectID2 = "id1"; - synonymHit_01.setObjectID(objectID2); - SynonymType type2 = SynonymType.fromValue("synonym"); - synonymHit_01.setType(type2); - List synonyms2 = new ArrayList<>(); { String synonyms_03 = "car"; - synonyms2.add(synonyms_03); String synonyms_13 = "vehicule"; - synonyms2.add(synonyms_13); String synonyms_23 = "auto"; - synonyms2.add(synonyms_23); } synonymHit_01.setSynonyms(synonyms2); } synonymHit0.add(synonymHit_01); - SynonymHit synonymHit_11 = new SynonymHit(); { String objectID2 = "id2"; - synonymHit_11.setObjectID(objectID2); - SynonymType type2 = SynonymType.fromValue("onewaysynonym"); - synonymHit_11.setType(type2); String input2 = "iphone"; - synonymHit_11.setInput(input2); - List synonyms2 = new ArrayList<>(); { String synonyms_03 = "ephone"; - synonyms2.add(synonyms_03); String synonyms_13 = "aphone"; - synonyms2.add(synonyms_13); String synonyms_23 = "yphone"; - synonyms2.add(synonyms_23); } synonymHit_11.setSynonyms(synonyms2); } synonymHit0.add(synonymHit_11); } - boolean forwardToReplicas0 = true; - boolean replaceExistingSynonyms0 = false; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -1983,11 +1785,9 @@ void saveSynonymsTest0() { @DisplayName("search with minimal parameters") void searchTest0() { String indexName0 = "indexName"; - SearchParamsObject searchParams0 = new SearchParamsObject(); { String query1 = "myQuery"; - searchParams0.setQuery(query1); } @@ -2015,17 +1815,13 @@ void searchTest0() { @DisplayName("search with facetFilters") void searchTest1() { String indexName0 = "indexName"; - SearchParamsObject searchParams0 = new SearchParamsObject(); { String query1 = "myQuery"; - searchParams0.setQuery(query1); - List facetFilters1 = new ArrayList<>(); { String facetFilters_02 = "tags:algolia"; - facetFilters1.add(facetFilters_02); } searchParams0.setFacetFilters(FacetFilters.ofListString(facetFilters1)); @@ -2055,11 +1851,9 @@ void searchTest1() { @DisplayName("get searchDictionaryEntries results with minimal parameters") void searchDictionaryEntriesTest0() { DictionaryType dictionaryName0 = DictionaryType.fromValue("compounds"); - SearchDictionaryEntriesParams searchDictionaryEntriesParams0 = new SearchDictionaryEntriesParams(); { String query1 = "foo"; - searchDictionaryEntriesParams0.setQuery(query1); } @@ -2087,22 +1881,15 @@ void searchDictionaryEntriesTest0() { @DisplayName("get searchDictionaryEntries results with all parameters") void searchDictionaryEntriesTest1() { DictionaryType dictionaryName0 = DictionaryType.fromValue("compounds"); - SearchDictionaryEntriesParams searchDictionaryEntriesParams0 = new SearchDictionaryEntriesParams(); { String query1 = "foo"; - searchDictionaryEntriesParams0.setQuery(query1); - int page1 = 4; - searchDictionaryEntriesParams0.setPage(page1); - int hitsPerPage1 = 2; - searchDictionaryEntriesParams0.setHitsPerPage(hitsPerPage1); String language1 = "fr"; - searchDictionaryEntriesParams0.setLanguage(language1); } @@ -2130,7 +1917,6 @@ void searchDictionaryEntriesTest1() { @DisplayName("get searchForFacetValues results with minimal parameters") void searchForFacetValuesTest0() { String indexName0 = "indexName"; - String facetName0 = "facetName"; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -2146,20 +1932,14 @@ void searchForFacetValuesTest0() { @DisplayName("get searchForFacetValues results with all parameters") void searchForFacetValuesTest1() { String indexName0 = "indexName"; - String facetName0 = "facetName"; - SearchForFacetValuesRequest searchForFacetValuesRequest0 = new SearchForFacetValuesRequest(); { String params1 = "query=foo&facetFilters=['bar']"; - searchForFacetValuesRequest0.setParams(params1); String facetQuery1 = "foo"; - searchForFacetValuesRequest0.setFacetQuery(facetQuery1); - int maxFacetHits1 = 42; - searchForFacetValuesRequest0.setMaxFacetHits(maxFacetHits1); } @@ -2188,11 +1968,9 @@ void searchForFacetValuesTest1() { @DisplayName("searchRules") void searchRulesTest0() { String indexName0 = "indexName"; - SearchRulesParams searchRulesParams0 = new SearchRulesParams(); { String query1 = "something"; - searchRulesParams0.setQuery(query1); } @@ -2233,18 +2011,12 @@ void searchUserIdsTest0() { SearchUserIdsParams searchUserIdsParams0 = new SearchUserIdsParams(); { String query1 = "test"; - searchUserIdsParams0.setQuery(query1); String clusterName1 = "theClusterName"; - searchUserIdsParams0.setClusterName(clusterName1); - int page1 = 5; - searchUserIdsParams0.setPage(page1); - int hitsPerPage1 = 10; - searchUserIdsParams0.setHitsPerPage(hitsPerPage1); } @@ -2275,15 +2047,10 @@ void setDictionarySettingsTest0() { Map plurals2 = new HashMap<>(); { boolean fr3 = false; - plurals2.put("fr", fr3); - boolean en3 = false; - plurals2.put("en", en3); - boolean ru3 = true; - plurals2.put("ru", ru3); } disableStandardEntries1.setPlurals(plurals2); @@ -2320,31 +2087,22 @@ void setDictionarySettingsTest1() { Map plurals2 = new HashMap<>(); { boolean fr3 = false; - plurals2.put("fr", fr3); - boolean en3 = false; - plurals2.put("en", en3); - boolean ru3 = true; - plurals2.put("ru", ru3); } disableStandardEntries1.setPlurals(plurals2); - Map stopwords2 = new HashMap<>(); { boolean fr3 = false; - stopwords2.put("fr", fr3); } disableStandardEntries1.setStopwords(stopwords2); - Map compounds2 = new HashMap<>(); { boolean ru3 = true; - compounds2.put("ru", ru3); } disableStandardEntries1.setCompounds(compounds2); @@ -2375,14 +2133,11 @@ void setDictionarySettingsTest1() { @DisplayName("setSettings") void setSettingsTest0() { String indexName0 = "theIndexName"; - IndexSettings indexSettings0 = new IndexSettings(); { int paginationLimitedTo1 = 10; - indexSettings0.setPaginationLimitedTo(paginationLimitedTo1); } - boolean forwardToReplicas0 = true; EchoResponseInterface req = (EchoResponseInterface) assertDoesNotThrow(() -> { @@ -2420,31 +2175,21 @@ void setSettingsTest0() { @DisplayName("updateApiKey") void updateApiKeyTest0() { String key0 = "myApiKey"; - ApiKey apiKey0 = new ApiKey(); { List acl1 = new ArrayList<>(); { Acl acl_02 = Acl.fromValue("search"); - acl1.add(acl_02); - Acl acl_12 = Acl.fromValue("addObject"); - acl1.add(acl_12); } apiKey0.setAcl(acl1); - int validity1 = 300; - apiKey0.setValidity(validity1); - int maxQueriesPerIPPerHour1 = 100; - apiKey0.setMaxQueriesPerIPPerHour(maxQueriesPerIPPerHour1); - int maxHitsPerQuery1 = 20; - apiKey0.setMaxHitsPerQuery(maxHitsPerQuery1); } diff --git a/tests/output/php/src/methods/requests/AbtestingTest.php b/tests/output/php/src/methods/requests/AbtestingTest.php index 4336e8f52a..86fc484000 100644 --- a/tests/output/php/src/methods/requests/AbtestingTest.php +++ b/tests/output/php/src/methods/requests/AbtestingTest.php @@ -83,12 +83,9 @@ protected function getClient() public function testAddABTests0() { $client = $this->getClient(); - $client->addABTests([ 'endAt' => '2022-12-31T00:00:00.000Z', - 'name' => 'myABTest', - 'variant' => [ ['index' => 'AB_TEST_1', 'trafficPercentage' => 30], @@ -114,7 +111,6 @@ public function testAddABTests0() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -132,7 +128,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -154,7 +149,6 @@ public function testDel1() public function testDeleteABTest0() { $client = $this->getClient(); - $client->deleteABTest(42); $this->assertRequests([ @@ -172,7 +166,6 @@ public function testDeleteABTest0() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -190,7 +183,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -212,7 +204,6 @@ public function testGet1() public function testGetABTest0() { $client = $this->getClient(); - $client->getABTest(42); $this->assertRequests([ @@ -230,7 +221,6 @@ public function testGetABTest0() public function testListABTests0() { $client = $this->getClient(); - $client->listABTests( 42, 21 @@ -254,7 +244,6 @@ public function testListABTests0() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -272,7 +261,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -296,7 +284,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -314,7 +301,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], @@ -338,7 +324,6 @@ public function testPut1() public function testStopABTest0() { $client = $this->getClient(); - $client->stopABTest(42); $this->assertRequests([ diff --git a/tests/output/php/src/methods/requests/AnalyticsTest.php b/tests/output/php/src/methods/requests/AnalyticsTest.php index 03fe2145b8..2f08524cae 100644 --- a/tests/output/php/src/methods/requests/AnalyticsTest.php +++ b/tests/output/php/src/methods/requests/AnalyticsTest.php @@ -83,7 +83,6 @@ protected function getClient() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -101,7 +100,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -123,7 +121,6 @@ public function testDel1() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -141,7 +138,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -163,7 +159,6 @@ public function testGet1() public function testGetAverageClickPosition0() { $client = $this->getClient(); - $client->getAverageClickPosition('index'); $this->assertRequests([ @@ -182,7 +177,6 @@ public function testGetAverageClickPosition0() public function testGetAverageClickPosition1() { $client = $this->getClient(); - $client->getAverageClickPosition( 'index', '1999-09-19', @@ -208,7 +202,6 @@ public function testGetAverageClickPosition1() public function testGetClickPositions0() { $client = $this->getClient(); - $client->getClickPositions('index'); $this->assertRequests([ @@ -227,7 +220,6 @@ public function testGetClickPositions0() public function testGetClickPositions1() { $client = $this->getClient(); - $client->getClickPositions( 'index', '1999-09-19', @@ -253,7 +245,6 @@ public function testGetClickPositions1() public function testGetClickThroughRate0() { $client = $this->getClient(); - $client->getClickThroughRate('index'); $this->assertRequests([ @@ -272,7 +263,6 @@ public function testGetClickThroughRate0() public function testGetClickThroughRate1() { $client = $this->getClient(); - $client->getClickThroughRate( 'index', '1999-09-19', @@ -298,7 +288,6 @@ public function testGetClickThroughRate1() public function testGetConversationRate0() { $client = $this->getClient(); - $client->getConversationRate('index'); $this->assertRequests([ @@ -317,7 +306,6 @@ public function testGetConversationRate0() public function testGetConversationRate1() { $client = $this->getClient(); - $client->getConversationRate( 'index', '1999-09-19', @@ -343,7 +331,6 @@ public function testGetConversationRate1() public function testGetNoClickRate0() { $client = $this->getClient(); - $client->getNoClickRate('index'); $this->assertRequests([ @@ -362,7 +349,6 @@ public function testGetNoClickRate0() public function testGetNoClickRate1() { $client = $this->getClient(); - $client->getNoClickRate( 'index', '1999-09-19', @@ -388,7 +374,6 @@ public function testGetNoClickRate1() public function testGetNoResultsRate0() { $client = $this->getClient(); - $client->getNoResultsRate('index'); $this->assertRequests([ @@ -407,7 +392,6 @@ public function testGetNoResultsRate0() public function testGetNoResultsRate1() { $client = $this->getClient(); - $client->getNoResultsRate( 'index', '1999-09-19', @@ -433,7 +417,6 @@ public function testGetNoResultsRate1() public function testGetSearchesCount0() { $client = $this->getClient(); - $client->getSearchesCount('index'); $this->assertRequests([ @@ -452,7 +435,6 @@ public function testGetSearchesCount0() public function testGetSearchesCount1() { $client = $this->getClient(); - $client->getSearchesCount( 'index', '1999-09-19', @@ -478,7 +460,6 @@ public function testGetSearchesCount1() public function testGetSearchesNoClicks0() { $client = $this->getClient(); - $client->getSearchesNoClicks('index'); $this->assertRequests([ @@ -497,7 +478,6 @@ public function testGetSearchesNoClicks0() public function testGetSearchesNoClicks1() { $client = $this->getClient(); - $client->getSearchesNoClicks( 'index', '1999-09-19', @@ -525,7 +505,6 @@ public function testGetSearchesNoClicks1() public function testGetSearchesNoResults0() { $client = $this->getClient(); - $client->getSearchesNoResults('index'); $this->assertRequests([ @@ -544,7 +523,6 @@ public function testGetSearchesNoResults0() public function testGetSearchesNoResults1() { $client = $this->getClient(); - $client->getSearchesNoResults( 'index', '1999-09-19', @@ -572,7 +550,6 @@ public function testGetSearchesNoResults1() public function testGetStatus0() { $client = $this->getClient(); - $client->getStatus('index'); $this->assertRequests([ @@ -591,7 +568,6 @@ public function testGetStatus0() public function testGetTopCountries0() { $client = $this->getClient(); - $client->getTopCountries('index'); $this->assertRequests([ @@ -610,7 +586,6 @@ public function testGetTopCountries0() public function testGetTopCountries1() { $client = $this->getClient(); - $client->getTopCountries( 'index', '1999-09-19', @@ -638,7 +613,6 @@ public function testGetTopCountries1() public function testGetTopFilterAttributes0() { $client = $this->getClient(); - $client->getTopFilterAttributes('index'); $this->assertRequests([ @@ -657,7 +631,6 @@ public function testGetTopFilterAttributes0() public function testGetTopFilterAttributes1() { $client = $this->getClient(); - $client->getTopFilterAttributes( 'index', 'mySearch', @@ -686,7 +659,6 @@ public function testGetTopFilterAttributes1() public function testGetTopFilterForAttribute0() { $client = $this->getClient(); - $client->getTopFilterForAttribute( 'myAttribute', 'index' @@ -708,7 +680,6 @@ public function testGetTopFilterForAttribute0() public function testGetTopFilterForAttribute1() { $client = $this->getClient(); - $client->getTopFilterForAttribute( 'myAttribute1,myAttribute2', 'index' @@ -730,7 +701,6 @@ public function testGetTopFilterForAttribute1() public function testGetTopFilterForAttribute2() { $client = $this->getClient(); - $client->getTopFilterForAttribute( 'myAttribute', 'index', @@ -760,7 +730,6 @@ public function testGetTopFilterForAttribute2() public function testGetTopFilterForAttribute3() { $client = $this->getClient(); - $client->getTopFilterForAttribute( 'myAttribute1,myAttribute2', 'index', @@ -790,7 +759,6 @@ public function testGetTopFilterForAttribute3() public function testGetTopFiltersNoResults0() { $client = $this->getClient(); - $client->getTopFiltersNoResults('index'); $this->assertRequests([ @@ -809,7 +777,6 @@ public function testGetTopFiltersNoResults0() public function testGetTopFiltersNoResults1() { $client = $this->getClient(); - $client->getTopFiltersNoResults( 'index', 'mySearch', @@ -838,7 +805,6 @@ public function testGetTopFiltersNoResults1() public function testGetTopHits0() { $client = $this->getClient(); - $client->getTopHits('index'); $this->assertRequests([ @@ -857,7 +823,6 @@ public function testGetTopHits0() public function testGetTopHits1() { $client = $this->getClient(); - $client->getTopHits( 'index', 'mySearch', @@ -887,7 +852,6 @@ public function testGetTopHits1() public function testGetTopSearches0() { $client = $this->getClient(); - $client->getTopSearches('index'); $this->assertRequests([ @@ -906,7 +870,6 @@ public function testGetTopSearches0() public function testGetTopSearches1() { $client = $this->getClient(); - $client->getTopSearches( 'index', true, @@ -937,7 +900,6 @@ public function testGetTopSearches1() public function testGetUsersCount0() { $client = $this->getClient(); - $client->getUsersCount('index'); $this->assertRequests([ @@ -956,7 +918,6 @@ public function testGetUsersCount0() public function testGetUsersCount1() { $client = $this->getClient(); - $client->getUsersCount( 'index', '1999-09-19', @@ -982,7 +943,6 @@ public function testGetUsersCount1() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -1000,7 +960,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -1024,7 +983,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -1042,7 +1000,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], diff --git a/tests/output/php/src/methods/requests/InsightsTest.php b/tests/output/php/src/methods/requests/InsightsTest.php index 1eb277e3c5..902a1222a7 100644 --- a/tests/output/php/src/methods/requests/InsightsTest.php +++ b/tests/output/php/src/methods/requests/InsightsTest.php @@ -83,7 +83,6 @@ protected function getClient() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -101,7 +100,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -123,7 +121,6 @@ public function testDel1() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -141,7 +138,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -163,7 +159,6 @@ public function testGet1() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -181,7 +176,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -205,54 +199,35 @@ public function testPost1() public function testPushEvents0() { $client = $this->getClient(); - $client->pushEvents([ 'events' => [ [ 'eventType' => 'click', - 'eventName' => 'Product Clicked', - 'index' => 'products', - 'userToken' => 'user-123456', - 'timestamp' => 1641290601962, - 'objectIDs' => ['9780545139700', '9780439784542'], - 'queryID' => '43b15df305339e827f0ac0bdc5ebcaa7', - 'positions' => [7, 6], ], [ 'eventType' => 'view', - 'eventName' => 'Product Detail Page Viewed', - 'index' => 'products', - 'userToken' => 'user-123456', - 'timestamp' => 1641290601962, - 'objectIDs' => ['9780545139700', '9780439784542'], ], [ 'eventType' => 'conversion', - 'eventName' => 'Product Purchased', - 'index' => 'products', - 'userToken' => 'user-123456', - 'timestamp' => 1641290601962, - 'objectIDs' => ['9780545139700', '9780439784542'], - 'queryID' => '43b15df305339e827f0ac0bdc5ebcaa7', ], ], @@ -276,7 +251,6 @@ public function testPushEvents0() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -294,7 +268,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], diff --git a/tests/output/php/src/methods/requests/PersonalizationTest.php b/tests/output/php/src/methods/requests/PersonalizationTest.php index 65977b3b80..6d5c699a17 100644 --- a/tests/output/php/src/methods/requests/PersonalizationTest.php +++ b/tests/output/php/src/methods/requests/PersonalizationTest.php @@ -83,7 +83,6 @@ protected function getClient() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -101,7 +100,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -123,7 +121,6 @@ public function testDel1() public function testDeleteUserProfile0() { $client = $this->getClient(); - $client->deleteUserProfile('UserToken'); $this->assertRequests([ @@ -141,7 +138,6 @@ public function testDeleteUserProfile0() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -159,7 +155,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -181,7 +176,6 @@ public function testGet1() public function testGetPersonalizationStrategy0() { $client = $this->getClient(); - $client->getPersonalizationStrategy(); $this->assertRequests([ @@ -199,7 +193,6 @@ public function testGetPersonalizationStrategy0() public function testGetUserTokenProfile0() { $client = $this->getClient(); - $client->getUserTokenProfile('UserToken'); $this->assertRequests([ @@ -217,7 +210,6 @@ public function testGetUserTokenProfile0() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -235,7 +227,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -259,7 +250,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -277,7 +267,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], @@ -301,20 +290,15 @@ public function testPut1() public function testSetPersonalizationStrategy0() { $client = $this->getClient(); - $client->setPersonalizationStrategy([ 'eventScoring' => [ [ 'score' => 42, - 'eventName' => 'Algolia', - 'eventType' => 'Event', ], ], - 'facetScoring' => [['score' => 42, 'facetName' => 'Event']], - 'personalizationImpact' => 42, ]); diff --git a/tests/output/php/src/methods/requests/QuerySuggestionsTest.php b/tests/output/php/src/methods/requests/QuerySuggestionsTest.php index 2e46154a3e..fbcf126a06 100644 --- a/tests/output/php/src/methods/requests/QuerySuggestionsTest.php +++ b/tests/output/php/src/methods/requests/QuerySuggestionsTest.php @@ -83,22 +83,16 @@ protected function getClient() public function testCreateConfig0() { $client = $this->getClient(); - $client->createConfig([ 'indexName' => 'theIndexName', - 'sourceIndices' => [ [ 'indexName' => 'testIndex', - 'facets' => [['attributes' => 'test']], - 'generate' => [['facetA', 'facetB'], ['facetC']], ], ], - 'languages' => ['french'], - 'exclude' => ['test'], ]); @@ -120,7 +114,6 @@ public function testCreateConfig0() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -138,7 +131,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -160,7 +152,6 @@ public function testDel1() public function testDeleteConfig0() { $client = $this->getClient(); - $client->deleteConfig('theIndexName'); $this->assertRequests([ @@ -178,7 +169,6 @@ public function testDeleteConfig0() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -196,7 +186,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -218,7 +207,6 @@ public function testGet1() public function testGetAllConfigs0() { $client = $this->getClient(); - $client->getAllConfigs(); $this->assertRequests([ @@ -236,7 +224,6 @@ public function testGetAllConfigs0() public function testGetConfig0() { $client = $this->getClient(); - $client->getConfig('theIndexName'); $this->assertRequests([ @@ -254,7 +241,6 @@ public function testGetConfig0() public function testGetConfigStatus0() { $client = $this->getClient(); - $client->getConfigStatus('theIndexName'); $this->assertRequests([ @@ -272,7 +258,6 @@ public function testGetConfigStatus0() public function testGetLogFile0() { $client = $this->getClient(); - $client->getLogFile('theIndexName'); $this->assertRequests([ @@ -290,7 +275,6 @@ public function testGetLogFile0() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -308,7 +292,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -332,7 +315,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -350,7 +332,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], @@ -374,22 +355,17 @@ public function testPut1() public function testUpdateConfig0() { $client = $this->getClient(); - $client->updateConfig( 'theIndexName', [ 'sourceIndices' => [ [ 'indexName' => 'testIndex', - 'facets' => [['attributes' => 'test']], - 'generate' => [['facetA', 'facetB'], ['facetC']], ], ], - 'languages' => ['french'], - 'exclude' => ['test'], ] ); diff --git a/tests/output/php/src/methods/requests/RecommendTest.php b/tests/output/php/src/methods/requests/RecommendTest.php index e0bdb28494..de9da5cc6e 100644 --- a/tests/output/php/src/methods/requests/RecommendTest.php +++ b/tests/output/php/src/methods/requests/RecommendTest.php @@ -83,7 +83,6 @@ protected function getClient() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -101,7 +100,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -123,7 +121,6 @@ public function testDel1() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -141,7 +138,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -163,16 +159,12 @@ public function testGet1() public function testGetRecommendations0() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName', - 'objectID' => 'objectID', - 'model' => 'related-products', - 'threshold' => 42, ], ], @@ -196,29 +188,20 @@ public function testGetRecommendations0() public function testGetRecommendations1() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName', - 'objectID' => 'objectID', - 'model' => 'related-products', - 'threshold' => 42, - 'maxRecommendations' => 10, - 'queryParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['query'], ], - 'fallbackParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['fallback'], ], ], @@ -243,14 +226,11 @@ public function testGetRecommendations1() public function testGetRecommendations2() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName', - 'model' => 'trending-items', - 'threshold' => 42, ], ], @@ -274,31 +254,21 @@ public function testGetRecommendations2() public function testGetRecommendations3() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName', - 'model' => 'trending-items', - 'threshold' => 42, - 'maxRecommendations' => 10, - 'facetName' => 'myFacetName', - 'facetValue' => 'myFacetValue', - 'queryParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['query'], ], - 'fallbackParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['fallback'], ], ], @@ -323,26 +293,19 @@ public function testGetRecommendations3() public function testGetRecommendations4() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName1', - 'objectID' => 'objectID1', - 'model' => 'related-products', - 'threshold' => 21, ], [ 'indexName' => 'indexName2', - 'objectID' => 'objectID2', - 'model' => 'related-products', - 'threshold' => 21, ], ], @@ -366,53 +329,36 @@ public function testGetRecommendations4() public function testGetRecommendations5() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName1', - 'objectID' => 'objectID1', - 'model' => 'related-products', - 'threshold' => 21, - 'maxRecommendations' => 10, - 'queryParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['query1'], ], - 'fallbackParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['fallback1'], ], ], [ 'indexName' => 'indexName2', - 'objectID' => 'objectID2', - 'model' => 'related-products', - 'threshold' => 21, - 'maxRecommendations' => 10, - 'queryParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['query2'], ], - 'fallbackParameters' => [ 'query' => 'myQuery', - 'facetFilters' => ['fallback2'], ], ], @@ -437,16 +383,12 @@ public function testGetRecommendations5() public function testGetRecommendations6() { $client = $this->getClient(); - $client->getRecommendations([ 'requests' => [ [ 'indexName' => 'indexName1', - 'objectID' => 'objectID1', - 'model' => 'bought-together', - 'threshold' => 42, ], ], @@ -470,7 +412,6 @@ public function testGetRecommendations6() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -488,7 +429,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -512,7 +452,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -530,7 +469,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], diff --git a/tests/output/php/src/methods/requests/SearchTest.php b/tests/output/php/src/methods/requests/SearchTest.php index bd878358a5..a1b06115f3 100644 --- a/tests/output/php/src/methods/requests/SearchTest.php +++ b/tests/output/php/src/methods/requests/SearchTest.php @@ -83,16 +83,11 @@ protected function getClient() public function testAddApiKey0() { $client = $this->getClient(); - $client->addApiKey([ 'acl' => ['search', 'addObject'], - 'description' => 'my new api key', - 'validity' => 300, - 'maxQueriesPerIPPerHour' => 100, - 'maxHitsPerQuery' => 20, ]); @@ -114,7 +109,6 @@ public function testAddApiKey0() public function testAddOrUpdateObject0() { $client = $this->getClient(); - $client->addOrUpdateObject( 'indexName', 'uniqueID', @@ -137,10 +131,8 @@ public function testAddOrUpdateObject0() public function testAppendSource0() { $client = $this->getClient(); - $client->appendSource([ 'source' => 'theSource', - 'description' => 'theDescription', ]); @@ -162,7 +154,6 @@ public function testAppendSource0() public function testAssignUserId0() { $client = $this->getClient(); - $client->assignUserId( 'userID', ['cluster' => 'theCluster'] @@ -187,7 +178,6 @@ public function testAssignUserId0() public function testBatch0() { $client = $this->getClient(); - $client->batch( 'theIndexName', [ @@ -215,7 +205,6 @@ public function testBatch0() public function testBatchAssignUserIds0() { $client = $this->getClient(); - $client->batchAssignUserIds( 'userID', ['cluster' => 'theCluster', 'users' => ['user1', 'user2']] @@ -242,20 +231,17 @@ public function testBatchAssignUserIds0() public function testBatchDictionaryEntries0() { $client = $this->getClient(); - $client->batchDictionaryEntries( 'compounds', [ 'requests' => [ [ 'action' => 'addEntry', - 'body' => ['objectID' => '1', 'language' => 'en'], ], [ 'action' => 'deleteEntry', - 'body' => ['objectID' => '2', 'language' => 'fr'], ], ], @@ -280,45 +266,31 @@ public function testBatchDictionaryEntries0() public function testBatchDictionaryEntries1() { $client = $this->getClient(); - $client->batchDictionaryEntries( 'compounds', [ 'clearExistingDictionaryEntries' => false, - 'requests' => [ [ 'action' => 'addEntry', - 'body' => [ 'objectID' => '1', - 'language' => 'en', - 'word' => 'fancy', - 'words' => ['believe', 'algolia'], - 'decomposition' => ['trust', 'algolia'], - 'state' => 'enabled', ], ], [ 'action' => 'deleteEntry', - 'body' => [ 'objectID' => '2', - 'language' => 'fr', - 'word' => 'humility', - 'words' => ['candor', 'algolia'], - 'decomposition' => ['grit', 'algolia'], - 'state' => 'enabled', ], ], @@ -344,17 +316,14 @@ public function testBatchDictionaryEntries1() public function testBatchRules0() { $client = $this->getClient(); - $client->batchRules( 'indexName', [ [ 'objectID' => 'a-rule-id', - 'conditions' => [ ['pattern' => 'smartphone', 'anchoring' => 'contains'], ], - 'consequence' => [ 'params' => ['filters' => 'category:smartphone'], ], @@ -362,11 +331,9 @@ public function testBatchRules0() [ 'objectID' => 'a-second-rule-id', - 'conditions' => [ ['pattern' => 'apple', 'anchoring' => 'contains'], ], - 'consequence' => ['params' => ['filters' => 'brand:apple']], ], ], @@ -395,7 +362,6 @@ public function testBatchRules0() public function testBrowse0() { $client = $this->getClient(); - $client->browse('indexName'); $this->assertRequests([ @@ -413,7 +379,6 @@ public function testBrowse0() public function testBrowse1() { $client = $this->getClient(); - $client->browse( 'indexName', ['params' => "query=foo&facetFilters=['bar']", 'cursor' => 'cts'] @@ -437,7 +402,6 @@ public function testBrowse1() public function testClearAllSynonyms0() { $client = $this->getClient(); - $client->clearAllSynonyms('indexName'); $this->assertRequests([ @@ -455,7 +419,6 @@ public function testClearAllSynonyms0() public function testClearObjects0() { $client = $this->getClient(); - $client->clearObjects('theIndexName'); $this->assertRequests([ @@ -473,7 +436,6 @@ public function testClearObjects0() public function testClearRules0() { $client = $this->getClient(); - $client->clearRules('indexName'); $this->assertRequests([ @@ -491,7 +453,6 @@ public function testClearRules0() public function testDel0() { $client = $this->getClient(); - $client->del('/test/minimal'); $this->assertRequests([ @@ -509,7 +470,6 @@ public function testDel0() public function testDel1() { $client = $this->getClient(); - $client->del( '/test/all', ['query' => 'parameters'] @@ -531,7 +491,6 @@ public function testDel1() public function testDeleteApiKey0() { $client = $this->getClient(); - $client->deleteApiKey('myTestApiKey'); $this->assertRequests([ @@ -549,7 +508,6 @@ public function testDeleteApiKey0() public function testDeleteBy0() { $client = $this->getClient(); - $client->deleteBy( 'theIndexName', ['query' => 'testQuery'] @@ -571,7 +529,6 @@ public function testDeleteBy0() public function testDeleteIndex0() { $client = $this->getClient(); - $client->deleteIndex('theIndexName'); $this->assertRequests([ @@ -589,7 +546,6 @@ public function testDeleteIndex0() public function testDeleteObject0() { $client = $this->getClient(); - $client->deleteObject( 'theIndexName', 'uniqueID' @@ -610,7 +566,6 @@ public function testDeleteObject0() public function testDeleteRule0() { $client = $this->getClient(); - $client->deleteRule( 'indexName', 'id1' @@ -631,7 +586,6 @@ public function testDeleteRule0() public function testDeleteSource0() { $client = $this->getClient(); - $client->deleteSource('theSource'); $this->assertRequests([ @@ -649,7 +603,6 @@ public function testDeleteSource0() public function testDeleteSynonym0() { $client = $this->getClient(); - $client->deleteSynonym( 'indexName', 'id1' @@ -670,7 +623,6 @@ public function testDeleteSynonym0() public function testGet0() { $client = $this->getClient(); - $client->get('/test/minimal'); $this->assertRequests([ @@ -688,7 +640,6 @@ public function testGet0() public function testGet1() { $client = $this->getClient(); - $client->get( '/test/all', ['query' => 'parameters'] @@ -710,7 +661,6 @@ public function testGet1() public function testGetApiKey0() { $client = $this->getClient(); - $client->getApiKey('myTestApiKey'); $this->assertRequests([ @@ -728,7 +678,6 @@ public function testGetApiKey0() public function testGetDictionaryLanguages0() { $client = $this->getClient(); - $client->getDictionaryLanguages(); $this->assertRequests([ @@ -746,7 +695,6 @@ public function testGetDictionaryLanguages0() public function testGetDictionarySettings0() { $client = $this->getClient(); - $client->getDictionarySettings(); $this->assertRequests([ @@ -764,7 +712,6 @@ public function testGetDictionarySettings0() public function testGetLogs0() { $client = $this->getClient(); - $client->getLogs( 5, 10, @@ -790,7 +737,6 @@ public function testGetLogs0() public function testGetObject0() { $client = $this->getClient(); - $client->getObject( 'theIndexName', 'uniqueID', @@ -815,14 +761,11 @@ public function testGetObject0() public function testGetObjects0() { $client = $this->getClient(); - $client->getObjects([ 'requests' => [ [ 'attributesToRetrieve' => ['attr1', 'attr2'], - 'objectID' => 'uniqueID', - 'indexName' => 'theIndexName', ], ], @@ -846,7 +789,6 @@ public function testGetObjects0() public function testGetRule0() { $client = $this->getClient(); - $client->getRule( 'indexName', 'id1' @@ -867,7 +809,6 @@ public function testGetRule0() public function testGetSettings0() { $client = $this->getClient(); - $client->getSettings('theIndexName'); $this->assertRequests([ @@ -885,7 +826,6 @@ public function testGetSettings0() public function testGetSources0() { $client = $this->getClient(); - $client->getSources(); $this->assertRequests([ @@ -903,7 +843,6 @@ public function testGetSources0() public function testGetSynonym0() { $client = $this->getClient(); - $client->getSynonym( 'indexName', 'id1' @@ -924,7 +863,6 @@ public function testGetSynonym0() public function testGetTask0() { $client = $this->getClient(); - $client->getTask( 'theIndexName', 123 @@ -945,7 +883,6 @@ public function testGetTask0() public function testGetTopUserIds0() { $client = $this->getClient(); - $client->getTopUserIds(); $this->assertRequests([ @@ -963,7 +900,6 @@ public function testGetTopUserIds0() public function testGetUserId0() { $client = $this->getClient(); - $client->getUserId('uniqueID'); $this->assertRequests([ @@ -981,7 +917,6 @@ public function testGetUserId0() public function testHasPendingMappings0() { $client = $this->getClient(); - $client->hasPendingMappings(true); $this->assertRequests([ @@ -1000,7 +935,6 @@ public function testHasPendingMappings0() public function testListApiKeys0() { $client = $this->getClient(); - $client->listApiKeys(); $this->assertRequests([ @@ -1018,7 +952,6 @@ public function testListApiKeys0() public function testListClusters0() { $client = $this->getClient(); - $client->listClusters(); $this->assertRequests([ @@ -1036,7 +969,6 @@ public function testListClusters0() public function testListIndices0() { $client = $this->getClient(); - $client->listIndices(8); $this->assertRequests([ @@ -1055,7 +987,6 @@ public function testListIndices0() public function testListUserIds0() { $client = $this->getClient(); - $client->listUserIds( 8, 100 @@ -1079,12 +1010,10 @@ public function testListUserIds0() public function testMultipleBatch0() { $client = $this->getClient(); - $client->multipleBatch([ 'requests' => [ [ 'action' => 'addObject', - 'body' => ['key' => 'value'], 'indexName' => 'theIndexName', ], @@ -1109,10 +1038,8 @@ public function testMultipleBatch0() public function testMultipleQueries0() { $client = $this->getClient(); - $client->multipleQueries([ 'requests' => [['indexName' => 'theIndexName']], - 'strategy' => 'stopIfEnoughMatches', ]); @@ -1134,32 +1061,23 @@ public function testMultipleQueries0() public function testMultipleQueries1() { $client = $this->getClient(); - $client->multipleQueries([ 'requests' => [ [ 'indexName' => 'theIndexName', - 'query' => 'test', - 'type' => 'facet', - 'facet' => 'theFacet', - 'params' => 'testParam', ], [ 'indexName' => 'theIndexName', - 'query' => 'test', - 'type' => 'default', - 'params' => 'testParam', ], ], - 'strategy' => 'stopIfEnoughMatches', ]); @@ -1181,14 +1099,11 @@ public function testMultipleQueries1() public function testOperationIndex0() { $client = $this->getClient(); - $client->operationIndex( 'theIndexName', [ 'operation' => 'copy', - 'destination' => 'dest', - 'scope' => ['rules', 'settings'], ] ); @@ -1211,14 +1126,12 @@ public function testOperationIndex0() public function testPartialUpdateObject0() { $client = $this->getClient(); - $client->partialUpdateObject( 'theIndexName', 'uniqueID', [ [ 'id1' => 'test', - 'id2' => ['_operation' => 'AddUnique', 'value' => 'test2'], ], ], @@ -1246,7 +1159,6 @@ public function testPartialUpdateObject0() public function testPost0() { $client = $this->getClient(); - $client->post('/test/minimal'); $this->assertRequests([ @@ -1264,7 +1176,6 @@ public function testPost0() public function testPost1() { $client = $this->getClient(); - $client->post( '/test/all', ['query' => 'parameters'], @@ -1288,7 +1199,6 @@ public function testPost1() public function testPut0() { $client = $this->getClient(); - $client->put('/test/minimal'); $this->assertRequests([ @@ -1306,7 +1216,6 @@ public function testPut0() public function testPut1() { $client = $this->getClient(); - $client->put( '/test/all', ['query' => 'parameters'], @@ -1330,7 +1239,6 @@ public function testPut1() public function testRemoveUserId0() { $client = $this->getClient(); - $client->removeUserId('uniqueID'); $this->assertRequests([ @@ -1348,7 +1256,6 @@ public function testRemoveUserId0() public function testReplaceSources0() { $client = $this->getClient(); - $client->replaceSources([ ['source' => 'theSource', 'description' => 'theDescription'], ]); @@ -1371,7 +1278,6 @@ public function testReplaceSources0() public function testRestoreApiKey0() { $client = $this->getClient(); - $client->restoreApiKey('myApiKey'); $this->assertRequests([ @@ -1389,7 +1295,6 @@ public function testRestoreApiKey0() public function testSaveObject0() { $client = $this->getClient(); - $client->saveObject( 'theIndexName', ['objectID' => 'id', 'test' => 'val'] @@ -1411,17 +1316,14 @@ public function testSaveObject0() public function testSaveRule0() { $client = $this->getClient(); - $client->saveRule( 'indexName', 'id1', [ 'objectID' => 'id1', - 'conditions' => [ ['pattern' => 'apple', 'anchoring' => 'contains'], ], - 'consequence' => ['params' => ['filters' => 'brand:apple']], ], true @@ -1448,15 +1350,12 @@ public function testSaveRule0() public function testSaveSynonym0() { $client = $this->getClient(); - $client->saveSynonym( 'indexName', 'id1', [ 'objectID' => 'id1', - 'type' => 'synonym', - 'synonyms' => ['car', 'vehicule', 'auto'], ], true @@ -1483,25 +1382,19 @@ public function testSaveSynonym0() public function testSaveSynonyms0() { $client = $this->getClient(); - $client->saveSynonyms( 'indexName', [ [ 'objectID' => 'id1', - 'type' => 'synonym', - 'synonyms' => ['car', 'vehicule', 'auto'], ], [ 'objectID' => 'id2', - 'type' => 'onewaysynonym', - 'input' => 'iphone', - 'synonyms' => ['ephone', 'aphone', 'yphone'], ], ], @@ -1530,7 +1423,6 @@ public function testSaveSynonyms0() public function testSearch0() { $client = $this->getClient(); - $client->search( 'indexName', ['query' => 'myQuery'] @@ -1552,7 +1444,6 @@ public function testSearch0() public function testSearch1() { $client = $this->getClient(); - $client->search( 'indexName', ['query' => 'myQuery', 'facetFilters' => ['tags:algolia']] @@ -1576,7 +1467,6 @@ public function testSearch1() public function testSearchDictionaryEntries0() { $client = $this->getClient(); - $client->searchDictionaryEntries( 'compounds', ['query' => 'foo'] @@ -1598,16 +1488,12 @@ public function testSearchDictionaryEntries0() public function testSearchDictionaryEntries1() { $client = $this->getClient(); - $client->searchDictionaryEntries( 'compounds', [ 'query' => 'foo', - 'page' => 4, - 'hitsPerPage' => 2, - 'language' => 'fr', ] ); @@ -1630,7 +1516,6 @@ public function testSearchDictionaryEntries1() public function testSearchForFacetValues0() { $client = $this->getClient(); - $client->searchForFacetValues( 'indexName', 'facetName' @@ -1651,15 +1536,12 @@ public function testSearchForFacetValues0() public function testSearchForFacetValues1() { $client = $this->getClient(); - $client->searchForFacetValues( 'indexName', 'facetName', [ 'params' => "query=foo&facetFilters=['bar']", - 'facetQuery' => 'foo', - 'maxFacetHits' => 42, ] ); @@ -1682,7 +1564,6 @@ public function testSearchForFacetValues1() public function testSearchRules0() { $client = $this->getClient(); - $client->searchRules( 'indexName', ['query' => 'something'] @@ -1704,7 +1585,6 @@ public function testSearchRules0() public function testSearchSynonyms0() { $client = $this->getClient(); - $client->searchSynonyms('indexName'); $this->assertRequests([ @@ -1722,14 +1602,10 @@ public function testSearchSynonyms0() public function testSearchUserIds0() { $client = $this->getClient(); - $client->searchUserIds([ 'query' => 'test', - 'clusterName' => 'theClusterName', - 'page' => 5, - 'hitsPerPage' => 10, ]); @@ -1751,7 +1627,6 @@ public function testSearchUserIds0() public function testSetDictionarySettings0() { $client = $this->getClient(); - $client->setDictionarySettings([ 'disableStandardEntries' => [ 'plurals' => ['fr' => false, 'en' => false, 'ru' => true], @@ -1776,7 +1651,6 @@ public function testSetDictionarySettings0() public function testSetDictionarySettings1() { $client = $this->getClient(); - $client->setDictionarySettings([ 'disableStandardEntries' => [ 'plurals' => ['fr' => false, 'en' => false, 'ru' => true], @@ -1803,7 +1677,6 @@ public function testSetDictionarySettings1() public function testSetSettings0() { $client = $this->getClient(); - $client->setSettings( 'theIndexName', ['paginationLimitedTo' => 10], @@ -1829,16 +1702,12 @@ public function testSetSettings0() public function testUpdateApiKey0() { $client = $this->getClient(); - $client->updateApiKey( 'myApiKey', [ 'acl' => ['search', 'addObject'], - 'validity' => 300, - 'maxQueriesPerIPPerHour' => 100, - 'maxHitsPerQuery' => 20, ] ); From 6f25543bbdfafd1083b2aab9d3cbae583c79975e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Fri, 29 Apr 2022 13:08:07 +0200 Subject: [PATCH 2/2] ofc --- .github/.cache_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.cache_version b/.github/.cache_version index deeb3d66ef..772853bd1a 100644 --- a/.github/.cache_version +++ b/.github/.cache_version @@ -1 +1 @@ -9.2.0 +9.2.0.0