Skip to content

feature/digital-twin-part-api-support#1483

Open
ds-vlisenco wants to merge 1 commit intoeclipse-tractusx:mainfrom
ds-vlisenco:feature/digital-twin-part-api-support
Open

feature/digital-twin-part-api-support#1483
ds-vlisenco wants to merge 1 commit intoeclipse-tractusx:mainfrom
ds-vlisenco:feature/digital-twin-part-api-support

Conversation

@ds-vlisenco
Copy link
Copy Markdown

Description
Refactor Integration Test with DigitalTwinPartApiSupport

This PR introduces a new support class DigitalTwinPartApiSupport to handle all REST interactions related to /digitalTwinPart endpoints.
It improves test maintainability, reduces duplication, and aligns with the established testing architecture (e.g., AssetsApiSupport).


Changes

  • Added: DigitalTwinPartApiSupport.java under integration/common/support
    • Endpoints covered:
      • POST /api/administration/digitalTwinPart
      • POST /api/administration/digitalTwinPart/detail
      • POST /api/administration/digitalTwinPart/searchable-values
    • Features:
      • JWT-based authorization using JwtRole.ADMIN
      • expectedStatusCode parameter for validation
      • Generic response deserialization with TypeRef<T> / Class<T>
      • Internal exception handling for JoseException
  • Refactored:
    • All test methods in DigitalTwinPartsControllerIT now use DigitalTwinPartApiSupport
    • Direct RestAssured calls removed from the test class
  • New Test Added:
    • shouldReturnSearchableValuesForFieldName()
      • Verifies functionality of /searchable-values endpoint
      • Fully based on the refactored structure

Notes

  • Fully tested in a private fork
  • No breaking changes
  • Compatible with existing codebase structure

Related
Closes #3 – Refactor Integration Test with DigitalTwinPartApiSupport


Pre-review checks
☑ Support class exists in correct package
☑ All /digitalTwinPart* calls extracted to support class
☑ Methods validate status code and return full response
☑ All tests pass and logic remains intact
☑ One new test using support class added
☑ Code reviewed and follows existing architectural standards

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.

1 participant