Skip to content

Eureka sprint 1 staging - #226

Merged
kaladay merged 2 commits into
mainfrom
eureka_sprint_1-staging
Aug 4, 2026
Merged

Eureka sprint 1 staging#226
kaladay merged 2 commits into
mainfrom
eureka_sprint_1-staging

Conversation

@kaladay

@kaladay kaladay commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator
  • Issue 223: Improve error handling and processing of OKAPI response.

kaladay and others added 2 commits June 16, 2026 10:23
This should already work when replacing the **OKAPI** **URL** with the **KONG** **URL**.
However, the error handling/reporting (and lack thereof) has made the process confusing and more problematic.

These changes help improve the design to improve the ability to investigate and handle problems with migrating to other services like **KONG**.

Ensure the **OKAPI** (or now **KONG**) response is in a separate `try..catch..` statement.
This will help properly identify and report problems with communicating to **OKAPI**.

Bring in the controller advice and similar functionality from other repositories, like **IBIS**.
This provides an actual response to the user on error.
Previously an error would result in no response on curl commands.
This is confusing and not ideal.

This also brings in the response **JSON** structure from **IBIS**.
**IBIS** uses **Java** record types, but that is not available for this repository because **Java** records are not supported in **Java 11**.
Implement this as a class with getters and setters.

Break apart the **HTTP** client and server errors into explicit exceptions so that they may be more explicitly handled.

Add and improve relevant NULL pointer checks in the **FOLIO** catalog service class.
In particular, the `response.hasBody()` check could fail because `response` could be NULL.
Then the `response.getBody()` can return NULL, so just check that for NULL directly rather than calling a function `hasBody()` to effectuate the NULL check.
Repeat this logic for the `isArray()` call.

Remove unnecessary `.toString()` call.

Prevent NULL pointer problems in `getDate()` with `input` by adding an explicit check.

The unit test structure is changed to handle the new behavior where a separate request to **OKAPI** is being made.
Disabling the trimming of the stack traces in exceptions so that unit test failures can be better interpreted.
…reka

Issue 223: Improve error handling and processing of OKAPI response.
@kaladay
kaladay requested a review from a team July 17, 2026 13:56
@coveralls

coveralls commented Jul 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29765155955

Coverage decreased (-1.0%) to 62.081%

Details

  • Coverage decreased (-1.0%) from the base build.
  • Patch coverage: 90 uncovered changes across 5 files (116 of 206 lines covered, 56.31%).
  • 21 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
service/src/main/java/edu/tamu/catalog/service/FolioCatalogService.java 135 69 51.11%
service/src/main/java/edu/tamu/catalog/exception/CatalogHttpClientException.java 10 2 20.0%
service/src/main/java/edu/tamu/catalog/exception/CatalogHttpServerException.java 10 2 20.0%
service/src/main/java/edu/tamu/catalog/advice/AbstractAdvice.java 23 18 78.26%
service/src/main/java/edu/tamu/catalog/advice/IndexAdvice.java 11 8 72.73%
Total (7 files) 206 116 56.31%

Coverage Regressions

21 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
service/src/main/java/edu/tamu/catalog/exception/RestExceptionHandler.java 20 5.0%
service/src/main/java/edu/tamu/catalog/service/FolioCatalogService.java 1 59.57%

Coverage Stats

Coverage Status
Relevant Lines: 1432
Covered Lines: 889
Line Coverage: 62.08%
Coverage Strength: 0.62 hits per line

💛 - Coveralls

@kaladay
kaladay merged commit e1f02b5 into main Aug 4, 2026
4 checks passed
@kaladay
kaladay deleted the eureka_sprint_1-staging branch August 5, 2026 13:17
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.

2 participants