From 097bf1c876adc6d4c1785dcff0993c473410ff39 Mon Sep 17 00:00:00 2001 From: gcxero Date: Thu, 3 Dec 2026 11:57:59 +1000 Subject: [PATCH] fix(test): compare Organisation class as string after spec change --- .../xero/models/accounting/Organisation.java | 130 +----------------- .../AccountingApiOrganisationsTest.java | 2 +- 2 files changed, 8 insertions(+), 124 deletions(-) diff --git a/src/main/java/com/xero/models/accounting/Organisation.java b/src/main/java/com/xero/models/accounting/Organisation.java index 1900a1b63..8151baac4 100644 --- a/src/main/java/com/xero/models/accounting/Organisation.java +++ b/src/main/java/com/xero/models/accounting/Organisation.java @@ -553,124 +553,8 @@ public static OrganisationEntityTypeEnum fromValue(String value) { @JsonProperty("ShortCode") private String shortCode; - /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) - */ - public enum PropertyClassEnum { - /** DEMO */ - DEMO("DEMO"), - - /** TRIAL */ - TRIAL("TRIAL"), - - /** STARTER */ - STARTER("STARTER"), - - /** STANDARD */ - STANDARD("STANDARD"), - - /** PREMIUM */ - PREMIUM("PREMIUM"), - - /** PREMIUM_20 */ - PREMIUM_20("PREMIUM_20"), - - /** PREMIUM_50 */ - PREMIUM_50("PREMIUM_50"), - - /** PREMIUM_100 */ - PREMIUM_100("PREMIUM_100"), - - /** LEDGER */ - LEDGER("LEDGER"), - - /** GST_CASHBOOK */ - GST_CASHBOOK("GST_CASHBOOK"), - - /** NON_GST_CASHBOOK */ - NON_GST_CASHBOOK("NON_GST_CASHBOOK"), - - /** ULTIMATE */ - ULTIMATE("ULTIMATE"), - - /** LITE */ - LITE("LITE"), - - /** ULTIMATE_10 */ - ULTIMATE_10("ULTIMATE_10"), - - /** ULTIMATE_20 */ - ULTIMATE_20("ULTIMATE_20"), - - /** ULTIMATE_50 */ - ULTIMATE_50("ULTIMATE_50"), - - /** ULTIMATE_100 */ - ULTIMATE_100("ULTIMATE_100"), - - /** IGNITE */ - IGNITE("IGNITE"), - - /** GROW */ - GROW("GROW"), - - /** COMPREHENSIVE */ - COMPREHENSIVE("COMPREHENSIVE"), - - /** SIMPLE */ - SIMPLE("SIMPLE"), - - /** BASICLITE */ - BASICLITE("BASICLITE"), - - /** ULTRA */ - ULTRA("ULTRA"); - - private String value; - - PropertyClassEnum(String value) { - this.value = value; - } - - /** - * getValue - * - * @return String value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * toString - * - * @return String value - */ - @Override - public String toString() { - return String.valueOf(value); - } - - /** - * fromValue - * - * @param value String - */ - @JsonCreator - public static PropertyClassEnum fromValue(String value) { - for (PropertyClassEnum b : PropertyClassEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - @JsonProperty("Class") - private PropertyClassEnum propertyClass; + private String propertyClass; /** * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting @@ -1727,10 +1611,10 @@ public void setShortCode(String shortCode) { * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, * PREMIUM) * - * @param propertyClass PropertyClassEnum + * @param propertyClass String * @return Organisation */ - public Organisation propertyClass(PropertyClassEnum propertyClass) { + public Organisation propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } @@ -1749,9 +1633,9 @@ public Organisation propertyClass(PropertyClassEnum propertyClass) { * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, * PREMIUM) * - * @return propertyClass PropertyClassEnum + * @return propertyClass String */ - public PropertyClassEnum getPropertyClass() { + public String getPropertyClass() { return propertyClass; } @@ -1759,9 +1643,9 @@ public PropertyClassEnum getPropertyClass() { * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, * PREMIUM) * - * @param propertyClass PropertyClassEnum + * @param propertyClass String */ - public void setPropertyClass(PropertyClassEnum propertyClass) { + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/src/test/java/com/xero/api/client/AccountingApiOrganisationsTest.java b/src/test/java/com/xero/api/client/AccountingApiOrganisationsTest.java index a2e945daa..1dbe91d2d 100644 --- a/src/test/java/com/xero/api/client/AccountingApiOrganisationsTest.java +++ b/src/test/java/com/xero/api/client/AccountingApiOrganisationsTest.java @@ -80,7 +80,7 @@ public void getOrganisationsTest() throws IOException { assertThat(response.getOrganisations().get(0).getTimezone(), is(equalTo(com.xero.models.accounting.TimeZone.NEWZEALANDSTANDARDTIME))); assertThat(response.getOrganisations().get(0).getOrganisationEntityType(), is(equalTo(com.xero.models.accounting.Organisation.OrganisationEntityTypeEnum.COMPANY))); assertThat(response.getOrganisations().get(0).getShortCode(), is(equalTo("!mBdtL"))); - assertThat(response.getOrganisations().get(0).getPropertyClass(), is(equalTo(com.xero.models.accounting.Organisation.PropertyClassEnum.PREMIUM))); + assertThat(response.getOrganisations().get(0).getPropertyClass(), is(equalTo("PREMIUM"))); assertThat(response.getOrganisations().get(0).getEdition(), is(equalTo(com.xero.models.accounting.Organisation.EditionEnum.BUSINESS))); //assertThat(response.getOrganisations().get(0).getRegistrationNumber(), is(equalTo("STRING_ONLY_PLACEHOLDER"))); //assertThat(response.getOrganisations().get(0).getLineOfBusiness(), is(equalTo("STRING_ONLY_PLACEHOLDER")));