From c66ec97afb0e83df184ce3ac2635f0f708c15307 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 28 Jul 2026 11:33:56 +0530 Subject: [PATCH] feat: add taxonomy and term publish, unpublish, localize, and unlocalize support Closes the parity gap with the JS SDK per DX-9676 by adding CMA taxonomy publish/unpublish and taxonomy/term-level localize/unlocalize methods, each live-verified against a real stack. Co-Authored-By: Claude Sonnet 5 --- .../contentstack/cms/core/ErrorMessages.java | 1 + .../com/contentstack/cms/stack/Taxonomy.java | 59 +++++++ .../cms/stack/TaxonomyService.java | 38 +++++ .../com/contentstack/cms/stack/Terms.java | 31 ++++ .../com/contentstack/cms/UnitTestSuite.java | 4 +- .../cms/stack/TaxonomyAPITest.java | 90 +++++++++++ .../contentstack/cms/stack/TaxonomyTest.java | 148 +++++++++++++++++- src/test/resources/mocktaxonomy/localize.json | 7 + .../resources/mocktaxonomy/localizeTerm.json | 8 + src/test/resources/mocktaxonomy/publish.json | 6 + 10 files changed, 390 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/mocktaxonomy/localize.json create mode 100644 src/test/resources/mocktaxonomy/localizeTerm.json create mode 100644 src/test/resources/mocktaxonomy/publish.json diff --git a/src/main/java/com/contentstack/cms/core/ErrorMessages.java b/src/main/java/com/contentstack/cms/core/ErrorMessages.java index 477809fa..420a0743 100644 --- a/src/main/java/com/contentstack/cms/core/ErrorMessages.java +++ b/src/main/java/com/contentstack/cms/core/ErrorMessages.java @@ -36,6 +36,7 @@ private ErrorMessages() { public static final String PUBLISH_QUEUE_UID_REQUIRED = "Publish Queue UID is required. Provide a valid Publish Queue UID and try again."; public static final String RELEASE_UID_REQUIRED = "Release UID is required. Provide a valid Release UID and try again."; public static final String ROLE_UID_REQUIRED = "Role UID is required. Provide a valid Role UID and try again."; + public static final String TAXONOMY_UID_REQUIRED = "Taxonomy UID is required. Provide a valid Taxonomy UID and try again."; public static final String VARIANT_GROUP_UID_REQUIRED = "Variant Group UID is required. Provide a valid Variant Group UID and try again."; public static final String WEBHOOK_UID_REQUIRED = "Webhook UID is required. Provide a valid Webhook UID and try again."; public static final String WORKFLOW_UID_REQUIRED = "Workflow UID is required. Provide a valid Workflow UID and try again."; diff --git a/src/main/java/com/contentstack/cms/stack/Taxonomy.java b/src/main/java/com/contentstack/cms/stack/Taxonomy.java index b3abca53..ea81cb6d 100644 --- a/src/main/java/com/contentstack/cms/stack/Taxonomy.java +++ b/src/main/java/com/contentstack/cms/stack/Taxonomy.java @@ -1,6 +1,7 @@ package com.contentstack.cms.stack; import com.contentstack.cms.BaseImplementation; +import com.contentstack.cms.core.ErrorMessages; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; import org.json.simple.JSONObject; @@ -8,6 +9,7 @@ import retrofit2.Retrofit; import java.util.HashMap; +import java.util.Objects; /** @@ -229,6 +231,63 @@ public Call delete(@NotNull String taxonomyId) { return this.taxonomyService.delete(this.headers, taxonomyId); } + /** + * Publish one or more taxonomies to the given environments/locales. + * Call on a collection-level instance, e.g. {@code stack.taxonomy()}. + * + * @param body the request body, e.g. {@code {"locales": [...], "environments": [...], "items": [{"uid": "..."}]}} + * @return the call Example
     {@code
+     *     Response response = taxonomy.publish(body).execute();
+     *     } 
+ */ + public Call publish(@NotNull JSONObject body) { + return this.taxonomyService.publish(this.headers, body); + } + + /** + * Unpublish one or more taxonomies from the given environments/locales. + * Call on a collection-level instance, e.g. {@code stack.taxonomy()}. + * + * @param body the request body, e.g. {@code {"locales": [...], "environments": [...], "items": [{"uid": "..."}]}} + * @return the call Example
     {@code
+     *     Response response = taxonomy.unpublish(body).execute();
+     *     } 
+ */ + public Call unpublish(@NotNull JSONObject body) { + return this.taxonomyService.unpublish(this.headers, body); + } + + /** + * Localize a taxonomy into the given locale. + * Call on an instance-level taxonomy, e.g. {@code stack.taxonomy("taxonomyId")}. + * + * @param body the request body, e.g. {@code {"taxonomy": {"name": "..."}}} + * @param locale the target locale, e.g. {@code hi-in} + * @return the call Example
     {@code
+     *     Response response = taxonomy.localize(body, "hi-in").execute();
+     *     } 
+ */ + public Call localize(@NotNull JSONObject body, @NotNull String locale) { + Objects.requireNonNull(this.taxonomyId, ErrorMessages.TAXONOMY_UID_REQUIRED); + this.params.put("locale", locale); + return this.taxonomyService.localize(this.headers, this.taxonomyId, this.params, body); + } + + /** + * Unlocalize a taxonomy from the given locale. + * Call on an instance-level taxonomy, e.g. {@code stack.taxonomy("taxonomyId")}. + * + * @param locale the locale to remove, e.g. {@code hi-in} + * @return the call Example
     {@code
+     *     Response response = taxonomy.unlocalize("hi-in").execute();
+     *     } 
+ */ + public Call unlocalize(@NotNull String locale) { + Objects.requireNonNull(this.taxonomyId, ErrorMessages.TAXONOMY_UID_REQUIRED); + this.params.put("locale", locale); + return this.taxonomyService.unlocalize(this.headers, this.taxonomyId, this.params); + } + /** * Clear params for internal uses only for testing diff --git a/src/main/java/com/contentstack/cms/stack/TaxonomyService.java b/src/main/java/com/contentstack/cms/stack/TaxonomyService.java index 571a9bcb..ae96ed9e 100644 --- a/src/main/java/com/contentstack/cms/stack/TaxonomyService.java +++ b/src/main/java/com/contentstack/cms/stack/TaxonomyService.java @@ -37,6 +37,29 @@ Call delete( @HeaderMap Map headers, @Path("taxonomy_uid") String uid); + @POST("taxonomies/publish") + Call publish( + @HeaderMap Map headers, + @Body JSONObject body); + + @POST("taxonomies/unpublish") + Call unpublish( + @HeaderMap Map headers, + @Body JSONObject body); + + @POST("taxonomies/{taxonomy_uid}") + Call localize( + @HeaderMap Map headers, + @Path("taxonomy_uid") String uid, + @QueryMap Map params, + @Body JSONObject body); + + @DELETE("taxonomies/{taxonomy_uid}") + Call unlocalize( + @HeaderMap Map headers, + @Path("taxonomy_uid") String uid, + @QueryMap Map params); + // --Terms-- @POST("taxonomies/{taxonomy_uid}/terms") @@ -87,6 +110,21 @@ Call reorder( @QueryMap Map queryParams, @Body JSONObject body); + @POST("taxonomies/{taxonomy_uid}/terms/{term_id}") + Call localizeTerm( + @HeaderMap HashMap headers, + @Path("taxonomy_uid") String taxonomyId, + @Path("term_id") String termId, + @QueryMap Map queryParams, + @Body JSONObject body); + + @DELETE("taxonomies/{taxonomy_uid}/terms/{term_id}") + Call unlocalizeTerm( + @HeaderMap HashMap headers, + @Path("taxonomy_uid") String taxonomyId, + @Path("term_id") String termId, + @QueryMap Map queryParams); + @GET("taxonomies/$all/terms") Call searchTerm( @HeaderMap HashMap headers, diff --git a/src/main/java/com/contentstack/cms/stack/Terms.java b/src/main/java/com/contentstack/cms/stack/Terms.java index 8f3a3a0c..021b09b3 100644 --- a/src/main/java/com/contentstack/cms/stack/Terms.java +++ b/src/main/java/com/contentstack/cms/stack/Terms.java @@ -278,6 +278,37 @@ public Call reorder(@NotNull String termUid, @NotNull JSONObject b return this.taxonomyService.reorder(this.headers, this.taxonomyId, termUid, this.params, body); } + /** + * Localize a term into the given locale. + * + * @param termUid the term to localize + * @param body the request body, e.g. {@code {"term": {"uid": "...", "name": "..."}}} + * @param locale the target locale, e.g. {@code hi-in} + * @return instance of Call

Example

 {@code
+     * Stack stack = new Contentstack.Builder().build().stack(headers);
+     * Term term = stack.taxonomy("taxonomyId").terms().localize("termId", body, "hi-in");
+     * } 
+ */ + public Call localize(@NotNull String termUid, @NotNull JSONObject body, @NotNull String locale) { + this.params.put("locale", locale); + return this.taxonomyService.localizeTerm(this.headers, this.taxonomyId, termUid, this.params, body); + } + + /** + * Unlocalize a term from the given locale. + * + * @param termUid the term to unlocalize + * @param locale the locale to remove, e.g. {@code hi-in} + * @return instance of Call

Example

 {@code
+     * Stack stack = new Contentstack.Builder().build().stack(headers);
+     * Term term = stack.taxonomy("taxonomyId").terms().unlocalize("termId", "hi-in");
+     * } 
+ */ + public Call unlocalize(@NotNull String termUid, @NotNull String locale) { + this.params.put("locale", locale); + return this.taxonomyService.unlocalizeTerm(this.headers, this.taxonomyId, termUid, this.params); + } + /** * Search call. diff --git a/src/test/java/com/contentstack/cms/UnitTestSuite.java b/src/test/java/com/contentstack/cms/UnitTestSuite.java index 9a54d743..ef67e11a 100644 --- a/src/test/java/com/contentstack/cms/UnitTestSuite.java +++ b/src/test/java/com/contentstack/cms/UnitTestSuite.java @@ -7,6 +7,7 @@ import com.contentstack.cms.stack.GlobalFieldUnitTests; import com.contentstack.cms.stack.LocaleUnitTest; import com.contentstack.cms.stack.ReleaseUnitTest; +import com.contentstack.cms.stack.TaxonomyTest; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; import org.junit.runner.RunWith; @@ -32,7 +33,8 @@ EnvironmentUnitTest.class, GlobalFieldUnitTests.class, LocaleUnitTest.class, - ReleaseUnitTest.class + ReleaseUnitTest.class, + TaxonomyTest.class }) public class UnitTestSuite { } diff --git a/src/test/java/com/contentstack/cms/stack/TaxonomyAPITest.java b/src/test/java/com/contentstack/cms/stack/TaxonomyAPITest.java index c1d61f3c..a8d762dd 100644 --- a/src/test/java/com/contentstack/cms/stack/TaxonomyAPITest.java +++ b/src/test/java/com/contentstack/cms/stack/TaxonomyAPITest.java @@ -215,6 +215,96 @@ void descendantsTerm(){ Assertions.assertNull(request.body()); Assertions.assertEquals("include_count=true", request.url().encodedQuery()); } + @Test + void publishTaxonomy() { + JSONObject publishBody = Utils.readJson("mocktaxonomy/publish.json"); + Request request = taxonomy.publish(publishBody).request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals("publish", request.url().pathSegments().get(2)); + Assertions.assertNotNull(request.body()); + } + + @Test + void unpublishTaxonomy() { + JSONObject unpublishBody = Utils.readJson("mocktaxonomy/publish.json"); + Request request = taxonomy.unpublish(unpublishBody).request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals("unpublish", request.url().pathSegments().get(2)); + Assertions.assertNotNull(request.body()); + } + + @Test + void localizeTaxonomy() { + Taxonomy uidTaxonomy = new Contentstack.Builder().setAuthtoken(TestClient.AUTHTOKEN).build() + .stack(API_KEY, MANAGEMENT_TOKEN).taxonomy(_uid); + JSONObject localizeBody = Utils.readJson("mocktaxonomy/localize.json"); + Request request = uidTaxonomy.localize(localizeBody, "hi-in").request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNotNull(request.body()); + } + + @Test + void unlocalizeTaxonomy() { + Taxonomy uidTaxonomy = new Contentstack.Builder().setAuthtoken(TestClient.AUTHTOKEN).build() + .stack(API_KEY, MANAGEMENT_TOKEN).taxonomy(_uid); + Request request = uidTaxonomy.unlocalize("hi-in").request(); + Assertions.assertEquals("DELETE", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNull(request.body()); + } + + @Test + void localizeTerm() throws IOException { + terms.clearParams(); + JSONObject localizeBody = Utils.readJson("mocktaxonomy/localizeTerm.json"); + Request request = terms.localize("india", localizeBody, "hi-in").request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(5, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("terms", request.url().pathSegments().get(3)); + Assertions.assertEquals("india", request.url().pathSegments().get(4)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNotNull(request.body()); + } + + @Test + void unlocalizeTerm() { + terms.clearParams(); + Request request = terms.unlocalize("india", "hi-in").request(); + Assertions.assertEquals("DELETE", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(5, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("terms", request.url().pathSegments().get(3)); + Assertions.assertEquals("india", request.url().pathSegments().get(4)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNull(request.body()); + } + @Test void moveTerms(){ terms.clearParams(); diff --git a/src/test/java/com/contentstack/cms/stack/TaxonomyTest.java b/src/test/java/com/contentstack/cms/stack/TaxonomyTest.java index 693a7db6..d793ccbf 100644 --- a/src/test/java/com/contentstack/cms/stack/TaxonomyTest.java +++ b/src/test/java/com/contentstack/cms/stack/TaxonomyTest.java @@ -2,6 +2,7 @@ import com.contentstack.cms.Contentstack; import com.contentstack.cms.TestClient; +import com.contentstack.cms.core.ErrorMessages; import com.contentstack.cms.core.Util; import okhttp3.Request; import okhttp3.ResponseBody; @@ -12,11 +13,12 @@ import retrofit2.Response; import java.io.IOException; +import java.util.Collections; import java.util.HashMap; @Tag("unit") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class TaxonomyTest { +public class TaxonomyTest { protected static String API_KEY = TestClient.API_KEY; protected static String _uid = TestClient.AUTHTOKEN; @@ -277,6 +279,43 @@ void testAncestorsTerm() { Assertions.assertEquals("include_children_count=false&include_referenced_entries_count=true", request.url().encodedQuery()); } + @Test + void testLocalizeTerm() { + terms.clearParams(); + JSONObject termDetails = new JSONObject(); + termDetails.put("uid", "term_1"); + termDetails.put("name", "Term 1 Hindi"); + JSONObject term = new JSONObject(); + term.put("term", termDetails); + Request request = terms.localize("term_1", term, "hi-in").request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(5, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("terms", request.url().pathSegments().get(3)); + Assertions.assertEquals("term_1", request.url().pathSegments().get(4)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNotNull(request.body()); + } + + @Test + void testUnlocalizeTerm() { + terms.clearParams(); + Request request = terms.unlocalize("term_1", "hi-in").request(); + Assertions.assertEquals("DELETE", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(5, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("terms", request.url().pathSegments().get(3)); + Assertions.assertEquals("term_1", request.url().pathSegments().get(4)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNull(request.body()); + } + @Test void findTestAPI() throws IOException { Taxonomy taxonomy = new Contentstack.Builder() @@ -289,6 +328,113 @@ void findTestAPI() throws IOException { System.out.println(response); } + + private static Taxonomy newTaxonomy() { + HashMap headers = new HashMap<>(); + headers.put(Util.API_KEY, API_KEY); + headers.put(Util.AUTHORIZATION, MANAGEMENT_TOKEN); + return new Contentstack.Builder().setAuthtoken(TestClient.AUTHTOKEN).build().stack(headers).taxonomy(); + } + + private static Taxonomy newTaxonomy(String uid) { + HashMap headers = new HashMap<>(); + headers.put(Util.API_KEY, API_KEY); + headers.put(Util.AUTHORIZATION, MANAGEMENT_TOKEN); + return new Contentstack.Builder().setAuthtoken(TestClient.AUTHTOKEN).build().stack(headers).taxonomy(uid); + } + + @Test + void publishTest() { + JSONObject publishBody = new JSONObject(); + publishBody.put("locales", Collections.singletonList("en-us")); + publishBody.put("environments", Collections.singletonList("production")); + Request request = taxonomy.publish(publishBody).request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals("publish", request.url().pathSegments().get(2)); + Assertions.assertNotNull(request.body()); + } + + @Test + void publishTestWithBranchHeader() { + Taxonomy localTaxonomy = newTaxonomy(); + localTaxonomy.addHeader("branch", "dev"); + JSONObject publishBody = new JSONObject(); + publishBody.put("locales", Collections.singletonList("en-us")); + Request request = localTaxonomy.publish(publishBody).request(); + Assertions.assertEquals("dev", request.header("branch")); + } + + @Test + void unpublishTest() { + JSONObject unpublishBody = new JSONObject(); + unpublishBody.put("locales", Collections.singletonList("en-us")); + unpublishBody.put("environments", Collections.singletonList("production")); + Request request = taxonomy.unpublish(unpublishBody).request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals("unpublish", request.url().pathSegments().get(2)); + Assertions.assertNotNull(request.body()); + } + + @Test + void localizeTest() { + Taxonomy uidTaxonomy = newTaxonomy(_uid); + JSONObject taxonomyDetails = new JSONObject(); + taxonomyDetails.put("uid", _uid); + taxonomyDetails.put("name", "Taxonomy 1"); + JSONObject localizeBody = new JSONObject(); + localizeBody.put("taxonomy", taxonomyDetails); + Request request = uidTaxonomy.localize(localizeBody, "hi-in").request(); + Assertions.assertEquals("POST", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNotNull(request.body()); + } + + @Test + void localizeTestWithoutUidThrows() { + JSONObject taxonomyDetails = new JSONObject(); + taxonomyDetails.put("uid", _uid); + taxonomyDetails.put("name", "Taxonomy 1"); + JSONObject localizeBody = new JSONObject(); + localizeBody.put("taxonomy", taxonomyDetails); + NullPointerException exception = Assertions.assertThrows(NullPointerException.class, + () -> taxonomy.localize(localizeBody, "hi-in")); + Assertions.assertEquals(ErrorMessages.TAXONOMY_UID_REQUIRED, exception.getMessage()); + } + + @Test + void unlocalizeTest() { + Taxonomy uidTaxonomy = newTaxonomy(_uid); + Request request = uidTaxonomy.unlocalize("hi-in").request(); + Assertions.assertEquals("DELETE", request.method()); + Assertions.assertTrue(request.url().isHttps()); + Assertions.assertEquals(3, request.url().pathSegments().size()); + Assertions.assertEquals("v3", request.url().pathSegments().get(0)); + Assertions.assertEquals("taxonomies", request.url().pathSegments().get(1)); + Assertions.assertEquals(_uid, request.url().pathSegments().get(2)); + Assertions.assertEquals("locale=hi-in", request.url().encodedQuery()); + Assertions.assertNull(request.body()); + } + + @Test + void unlocalizeTestWithoutUidThrows() { + NullPointerException exception = Assertions.assertThrows(NullPointerException.class, + () -> taxonomy.unlocalize("hi-in")); + Assertions.assertEquals(ErrorMessages.TAXONOMY_UID_REQUIRED, exception.getMessage()); + } + @Test void queryFiltersOnTaxonomy() { Taxonomy taxonomy = new Contentstack.Builder() diff --git a/src/test/resources/mocktaxonomy/localize.json b/src/test/resources/mocktaxonomy/localize.json new file mode 100644 index 00000000..18ae725d --- /dev/null +++ b/src/test/resources/mocktaxonomy/localize.json @@ -0,0 +1,7 @@ +{ + "taxonomy": { + "uid": "sample_one", + "name": "Sample One in Hindi", + "description": "Description for the sample one taxonomy in Hindi." + } + } \ No newline at end of file diff --git a/src/test/resources/mocktaxonomy/localizeTerm.json b/src/test/resources/mocktaxonomy/localizeTerm.json new file mode 100644 index 00000000..b2d516c9 --- /dev/null +++ b/src/test/resources/mocktaxonomy/localizeTerm.json @@ -0,0 +1,8 @@ +{ + "term": { + "uid": "india", + "name": "India in Hindi", + "parent_uid": null, + "order": 1 + } +} \ No newline at end of file diff --git a/src/test/resources/mocktaxonomy/publish.json b/src/test/resources/mocktaxonomy/publish.json new file mode 100644 index 00000000..931580a1 --- /dev/null +++ b/src/test/resources/mocktaxonomy/publish.json @@ -0,0 +1,6 @@ + +{ + "locales": ["en-us"], + "environments": ["production"], + "items": [{ "uid": "sample_one" }] + } \ No newline at end of file