[DCAEGEN2] Enhance a junit AppConfigTest::checkCorrectConsumerConfiguration 12/132912/2
authorSushant Jadhav <Sushant.Jadhav@t-systems.com>
Thu, 12 Jan 2023 10:46:10 +0000 (16:16 +0530)
committersushant53 <Sushant.Jadhav@t-systems.com>
Fri, 13 Jan 2023 13:01:52 +0000 (18:31 +0530)
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 <Sushant.Jadhav@t-systems.com>
[DCAEGEN2] Enhance a junit AppConfigTest::checkCorrectConsumerConfiguration

Mentioned year 2023 in copyright section

Issue-ID: DCAEGEN2-3324
Change-Id: I418bd9e44304d617c0eb875008f8af5826692cfa
Signed-off-by: sushant53 <Sushant.Jadhav@t-systems.com>
datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java

index 3c94029..dd59243 100644 (file)
@@ -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();
     }