From b1125ecc1a211121d65b812dc85f028ad4f5fb31 Mon Sep 17 00:00:00 2001 From: Sushant Jadhav Date: Thu, 12 Jan 2023 16:16:10 +0530 Subject: [DCAEGEN2] Enhance a junit AppConfigTest::checkCorrectConsumerConfiguration Change hardcoded unix-style path in the assertions to make it OS agnostic Issue-ID: DCAEGEN2-3324 Change-Id: I418bd9e44304d617c0eb875008f8af5826692cfa Signed-off-by: Sushant Jadhav [DCAEGEN2] Enhance a junit AppConfigTest::checkCorrectConsumerConfiguration Mentioned year 2023 in copyright section Issue-ID: DCAEGEN2-3324 Change-Id: I418bd9e44304d617c0eb875008f8af5826692cfa Signed-off-by: sushant53 --- .../dcaegen2/collectors/datafile/configuration/AppConfigTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java index 3c940297..dd592433 100644 --- a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java +++ b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START====================================================================== * Copyright (C) 2018, 2020-2022 Nokia. All rights reserved. * Copyright (C) 2018-2019 Nordix Foundation. All rights reserved. + * Copyright (C) 2023 Deutsche Telekom AG. All rights reserved. * =============================================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,6 +40,7 @@ import org.onap.dcaegen2.services.sdk.security.ssl.SecurityKeys; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import java.nio.file.Path; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -291,8 +293,9 @@ class AppConfigTest { assertThat(messageRouterSubscribeRequest.sourceDefinition().topicUrl()) .isEqualTo("http://localhost:2222/events/unauthenticated.VES_NOTIFICATION_OUTPUT"); SecurityKeys securityKeys = consumerConfiguration.getMessageRouterSubscriberConfig().securityKeys(); - assertThat(securityKeys.keyStore().path().toString()).hasToString("src/test/resources/cert.jks"); - assertThat(securityKeys.trustStore().path().toString()).hasToString("src/test/resources/trust.jks"); + assertThat(securityKeys.keyStore().path().toString()).hasToString(Path.of("src", "test","resources","cert.jks").toString()); + assertThat(securityKeys.trustStore().path().toString()).hasToString(Path.of("src", "test","resources","trust.jks").toString()); + assertThat(consumerConfiguration.getMessageRouterSubscriber()).isNotNull(); } -- cgit 1.2.3-korg