Skip to content

fix(test): compare Organisation class as string after spec change - #469

Merged
gcxero merged 1 commit into
XeroAPI:masterfrom
gcxero:fix/java-sdk-tests
Dec 3, 2026
Merged

gcxero merged 1 commit into
XeroAPI:masterfrom
gcxero:fix/java-sdk-tests

Conversation

@gcxero

@gcxero gcxero commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Xero-OpenAPI#862 changed Organisation.Class from enum to x-extensible-enum. openapi-generator does not recognise that extension, so the model now generates propertyClass as a plain String and Organisation.PropertyClassEnum no longer exists. The 19.0.0 codegen build failed to compile AccountingApiOrganisationsTest, which still referenced PropertyClassEnum.PREMIUM.

Changes:

  • Assert getPropertyClass() against the string "PREMIUM"
  • Update Organisation.java to the generated String shape so this repo's CI compiles before the next codegen release overwrites it

Validation

Reproduced the CI failure locally

  • Changed Organisation.java to the 19.0.0 generated shape (propertyClass as String, PropertyClassEnum removed), matching the output for Xero-OpenAPI#862 (Class moved from enum to x-extensible-enum).
  • Compiled it with the unmodified test (mvn clean test-compile). This gave the same error as the codegen pipeline:
    AccountingApiOrganisationsTest.java:[83,125] cannot find symbol: variable PropertyClassEnum

@gcxero
gcxero marked this pull request as ready for review December 3, 2026 01:58

@MikeLiuty MikeLiuty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@gcxero
gcxero merged commit 322387e into XeroAPI:master Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants