diff options
author | prathamesh morde <prathamesh.morde@bell.ca> | 2019-03-25 16:55:21 -0400 |
---|---|---|
committer | prathamesh morde <prathamesh.morde@bell.ca> | 2019-03-25 16:57:21 -0400 |
commit | 55e6e9e3614a32b5491d0e8fc2c5105a14d6779c (patch) | |
tree | 8e2b6356536fa2051f7f7cdcf66cc1998a7a00b9 /ms/cds-sdc-listener/application/src/test | |
parent | c90edac236dffb7c495e266dd04991de7e8f04b7 (diff) |
CDS-SDC Listener application
-Added logic to parse the CBA archive from CSAR package.
Issue-ID: CCSDK-349
Change-Id: I9aaf3a3c9298ccbb40fa9b7945ff1a20b66c2c17
Signed-off-by: prathamesh morde <prathamesh.morde@bell.ca>
Diffstat (limited to 'ms/cds-sdc-listener/application/src/test')
2 files changed, 44 insertions, 0 deletions
diff --git a/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/cds/cdssdclistener/service/ListenerServiceImplTest.java b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/cds/cdssdclistener/service/ListenerServiceImplTest.java new file mode 100644 index 000000000..05e1ffdec --- /dev/null +++ b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/cds/cdssdclistener/service/ListenerServiceImplTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2019 Bell Canada. All rights reserved. + * + * NOTICE: All the intellectual and technical concepts contained herein are + * proprietary to Bell Canada and are protected by trade secret or copyright law. + * Unauthorized copying of this file, via any medium is strictly prohibited. + */ + +package org.onap.ccsdk.cds.cdssdclistener.service; + +import java.nio.file.Path; +import java.nio.file.Paths; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@EnableConfigurationProperties(ListenerServiceImpl.class) +@SpringBootTest(classes = {ListenerServiceImplTest.class}) +public class ListenerServiceImplTest { + + private static final String CSAR_SAMPLE = "src/test/resources/service-Testsvc140.csar"; + private Path tempDirectoryPath; + + @Rule + public TemporaryFolder folder = new TemporaryFolder(); + + @Autowired + private ListenerServiceImpl listenerService; + + @Test + public void extractBluePrintSuccessfully() { + // Arrange + tempDirectoryPath = Paths.get(folder.getRoot().toString(), "cds-sdc-listener-test"); + + // Act + listenerService.extractBluePrint(CSAR_SAMPLE, tempDirectoryPath.toString()); + } +} diff --git a/ms/cds-sdc-listener/application/src/test/resources/service-Testsvc140.csar b/ms/cds-sdc-listener/application/src/test/resources/service-Testsvc140.csar Binary files differnew file mode 100644 index 000000000..4aa0de72b --- /dev/null +++ b/ms/cds-sdc-listener/application/src/test/resources/service-Testsvc140.csar |