-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WiP] Handle exception when fetching catalog data #800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
extensions/wrapper/wrapper/src/main/java/de/sovity/edc/ext/wrapper/api/ui/UiResourceImpl.java
Show resolved
Hide resolved
.../wrapper/src/main/java/de/sovity/edc/ext/wrapper/api/ui/pages/catalog/CatalogApiService.java
Show resolved
Hide resolved
...pper/src/test/java/de/sovity/edc/ext/wrapper/api/ui/pages/catalog/CatalogApiServiceTest.java
Show resolved
Hide resolved
val service = new CatalogApiService(mock(AssetMapper.class), mock(PolicyMapper.class), catalogApiService); | ||
|
||
// act | ||
val exception = assertThrows(WebApplicationException.class, () -> service.fetchDataOffers("http:example.com")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be minimized to "http://a"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even ""
would work, because this is mocked and as long as it gets a string it works.
Does it matter that it be short?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nit but "http://a" is short and shows the input is a URL
and short is nice
// act | ||
val exception = assertThrows( | ||
DspCatalogServiceException.class, | ||
() -> service.fetchDataOffers("http://example.com")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be minimized to "http://a"
return future | ||
.get() | ||
.orElseThrow(DspCatalogServiceException::ofFailure); | ||
} catch (CancellationException | ExecutionException | InterruptedException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InterruptedException must always be re-thrown
Outdated |
#797
Checklist