@@ -1614,6 +1614,38 @@ public void getArticleTranslations() throws Exception {
16141614 }
16151615 }
16161616
1617+ @ Test
1618+ public void showArticleTranslation () throws Exception {
1619+ createClientWithTokenOrPassword ();
1620+ List <String > locales = instance .getHelpCenterLocales ();
1621+
1622+ int articleCount = 0 ;
1623+
1624+ for (Article article : instance .getArticles ()) {
1625+ assertNotNull (article .getId ());
1626+
1627+ if (++articleCount > 10 ) {
1628+ break ;
1629+ }
1630+
1631+ int translationCount = 0 ;
1632+
1633+ for (String locale : locales ) {
1634+ Translation translation = instance .showArticleTranslation (article .getId (), locale );
1635+
1636+ // if there is no translation for the given locale the endpoint will return null
1637+ if (translation != null ) {
1638+ assertNotNull (translation .getId ());
1639+ assertNotNull (translation .getTitle ());
1640+ }
1641+
1642+ if (++translationCount > 3 ) {
1643+ break ;
1644+ }
1645+ }
1646+ }
1647+ }
1648+
16171649 @ Test
16181650 public void getSectionTranslations () throws Exception {
16191651 createClientWithTokenOrPassword ();
@@ -1636,6 +1668,38 @@ public void getSectionTranslations() throws Exception {
16361668 }
16371669 }
16381670
1671+ @ Test
1672+ public void showSectionTranslation () throws Exception {
1673+ createClientWithTokenOrPassword ();
1674+ List <String > locales = instance .getHelpCenterLocales ();
1675+
1676+ int sectionCount = 0 ;
1677+
1678+ for (Section section : instance .getSections ()) {
1679+ assertNotNull (section .getId ());
1680+
1681+ if (++sectionCount > 10 ) {
1682+ break ;
1683+ }
1684+
1685+ int translationCount = 0 ;
1686+
1687+ for (String locale : locales ) {
1688+ Translation translation = instance .showSectionTranslation (section .getId (), locale );
1689+
1690+ // if there is no translation for the given locale the endpoint will return null
1691+ if (translation != null ) {
1692+ assertNotNull (translation .getId ());
1693+ assertNotNull (translation .getTitle ());
1694+ }
1695+
1696+ if (++translationCount > 3 ) {
1697+ break ;
1698+ }
1699+ }
1700+ }
1701+ }
1702+
16391703 @ Test
16401704 public void getCategoryTranslations () throws Exception {
16411705 createClientWithTokenOrPassword ();
@@ -1658,6 +1722,38 @@ public void getCategoryTranslations() throws Exception {
16581722 }
16591723 }
16601724
1725+ @ Test
1726+ public void showCategoryTranslation () throws Exception {
1727+ createClientWithTokenOrPassword ();
1728+ List <String > locales = instance .getHelpCenterLocales ();
1729+
1730+ int categoryCount = 0 ;
1731+
1732+ for (Category category : instance .getCategories ()) {
1733+ assertNotNull (category .getId ());
1734+
1735+ if (++categoryCount > 10 ) {
1736+ break ;
1737+ }
1738+
1739+ int translationCount = 0 ;
1740+
1741+ for (String locale : locales ) {
1742+ Translation translation = instance .showCategoryTranslation (category .getId (), locale );
1743+
1744+ // if there is no translation for the given locale the endpoint will return null
1745+ if (translation != null ) {
1746+ assertNotNull (translation .getId ());
1747+ assertNotNull (translation .getTitle ());
1748+ }
1749+
1750+ if (++translationCount > 3 ) {
1751+ break ;
1752+ }
1753+ }
1754+ }
1755+ }
1756+
16611757 @ Test
16621758 public void getArticlesIncrementally () throws Exception {
16631759 createClientWithTokenOrPassword ();
0 commit comments