diff options
author | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2018-08-14 12:52:28 +0200 |
---|---|---|
committer | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2018-08-16 10:09:12 +0200 |
commit | 5e93c1ec9d690d7da15b7c0db0052121d8879471 (patch) | |
tree | 5bb91c52a28fa66bdb259748ee1f61ff37963760 /hv-collector-health-check/src/test/kotlin/org/onap/dcae | |
parent | 8a2552ac94981cfa18cce551066d9ca4ec668558 (diff) |
Remove Ratpack dependency for HV-VES health checks
In order to minimize complexity and possibly improve performance (thread count)
reactor-netty should be used instead of Ratpack. Also reorganize code to
be more consistent and differentiated readiness and liveness endpoints
(for future use in K8s Pod definition).
As an example I've defined health check probe in docker-compose YAML.
Change-Id: I1b5ce3d685e7ae5b0515b2146ae4fa88b3b41186
Issue-ID: DCAEGEN2-705
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'hv-collector-health-check/src/test/kotlin/org/onap/dcae')
-rw-r--r-- | hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt b/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt index e9c487bf..e3fced2d 100644 --- a/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt +++ b/hv-collector-health-check/src/test/kotlin/org/onap/dcae/collectors/veshv/healthcheck/impl/HealthStateProviderImplTest.kt @@ -21,10 +21,9 @@ package org.onap.dcae.collectors.veshv.healthcheck.impl import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.given import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on -import org.onap.dcae.collectors.veshv.healthcheck.api.HealthState +import org.onap.dcae.collectors.veshv.healthcheck.api.HealthDescription import reactor.test.StepVerifier /** @@ -33,20 +32,20 @@ import reactor.test.StepVerifier */ object HealthStateProviderImplTest : Spek({ describe("Health state provider") { - val healthStateProviderImpl = HealthStateProviderImpl() + val healthStateProviderImpl = HealthStateImpl() on("health state update") { - healthStateProviderImpl.changeState(HealthState.HEALTHY) - healthStateProviderImpl.changeState(HealthState.WAITING_FOR_CONSUL_CONFIGURATION) - healthStateProviderImpl.changeState(HealthState.WAITING_FOR_CONSUL_CONFIGURATION) - healthStateProviderImpl.changeState(HealthState.CONSUL_CONFIGURATION_NOT_FOUND) + healthStateProviderImpl.changeState(HealthDescription.HEALTHY) + healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION) + healthStateProviderImpl.changeState(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION) + healthStateProviderImpl.changeState(HealthDescription.CONSUL_CONFIGURATION_NOT_FOUND) it("should push new health state to the subscriber") { StepVerifier .create(healthStateProviderImpl().take(4)) - .expectNext(HealthState.HEALTHY) - .expectNext(HealthState.WAITING_FOR_CONSUL_CONFIGURATION) - .expectNext(HealthState.WAITING_FOR_CONSUL_CONFIGURATION) - .expectNext(HealthState.CONSUL_CONFIGURATION_NOT_FOUND) + .expectNext(HealthDescription.HEALTHY) + .expectNext(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION) + .expectNext(HealthDescription.RETRYING_FOR_CONSUL_CONFIGURATION) + .expectNext(HealthDescription.CONSUL_CONFIGURATION_NOT_FOUND) .verifyComplete() } } |