Kai Moritz [Fri, 10 Jan 2020 19:07:51 +0000 (20:07 +0100)]
Implemented a narrow integration-test: DemoApplicationIT
* Using testcontainers.org to start a Nginx-server in a container
* Using mock-server.org to intercept the HTTP-requests, if needed
* Implemented IntegrationTestBase to start Nginx and MockServer
* src/test/resources/index.html is needed, because the NginxContainer
checks for it
* Using Jsoup to pick the remotly fetched text out of the rendered HTML
Kai Moritz [Tue, 14 Jan 2020 23:45:15 +0000 (00:45 +0100)]
RestController throws different exceptions for other errors
* Goal: distinguish between errors, that occure during the fetching of the
data and errors, that may occure elswhere in RemoteController
* Added an unit-test, that verifies the distinction
* Fixed the behavior of RestController accordingly
Kai Moritz [Tue, 14 Jan 2020 19:11:06 +0000 (20:11 +0100)]
Verified, that RestController throws NotFound, if remote-data does not exist
* This tests may seem to check the value reached into the class by the test
itself, because RestController simply returns the fetched Mono at the
moment
* But it is valuable, because it verifies, that the behavior stays unchanged,
when the implementation of RestControler is changed
Kai Moritz [Tue, 14 Jan 2020 16:26:16 +0000 (17:26 +0100)]
Checked, that the error-messeage is rendered for other common errors
* Added a unit-test, that defines the expected behavior for other errors
* Since the HtmlController simply used getMessage(), no modification was
necessary to comply with the added test