diff --git a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedStringImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedStringImpl.java index 69d19957556..a70872a232d 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedStringImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedStringImpl.java @@ -12,6 +12,8 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; /** * LocalizedString implementation @@ -57,4 +59,9 @@ public int hashCode() { return new HashCodeBuilder(17, 37).append(values).toHashCode(); } + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("values", values).build(); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java/com/commercetools/LocalizedStringTest.java b/commercetools/commercetools-sdk-java-api/src/test/java/com/commercetools/LocalizedStringTest.java index e147dbc471c..fc61f044729 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java/com/commercetools/LocalizedStringTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java/com/commercetools/LocalizedStringTest.java @@ -13,7 +13,6 @@ import com.commercetools.api.models.common.LocalizedString; import com.commercetools.api.models.common.LocalizedStringEntry; -import io.vrap.rmf.base.client.ModelBase; import io.vrap.rmf.base.client.utils.json.JsonUtils; import org.apache.commons.lang3.StringUtils; @@ -186,7 +185,7 @@ public void returnPresentLocales() throws Exception { @Test public void implementToString() throws Exception { - assertThat(((ModelBase) LOCALIZED_STRING).reflectionString()) + assertThat(LOCALIZED_STRING.toString()) .isEqualTo(format("LocalizedStringImpl[values={de=%s, en=%s}]", DEFAULT_STRING_1, DEFAULT_STRING_2)); }