05e1ffdecd09063f3fd863d6cabf22a930ce399d
[ccsdk/cds.git] /
1 /*
2  * Copyright (C) 2019 Bell Canada. All rights reserved.
3  *
4  * NOTICE:  All the intellectual and technical concepts contained herein are
5  * proprietary to Bell Canada and are protected by trade secret or copyright law.
6  * Unauthorized copying of this file, via any medium is strictly prohibited.
7  */
8
9 package org.onap.ccsdk.cds.cdssdclistener.service;
10
11 import java.nio.file.Path;
12 import java.nio.file.Paths;
13 import org.junit.Rule;
14 import org.junit.Test;
15 import org.junit.rules.TemporaryFolder;
16 import org.junit.runner.RunWith;
17 import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.boot.context.properties.EnableConfigurationProperties;
19 import org.springframework.boot.test.context.SpringBootTest;
20 import org.springframework.test.context.junit4.SpringRunner;
21
22 @RunWith(SpringRunner.class)
23 @EnableConfigurationProperties(ListenerServiceImpl.class)
24 @SpringBootTest(classes = {ListenerServiceImplTest.class})
25 public class ListenerServiceImplTest {
26
27     private static final String CSAR_SAMPLE = "src/test/resources/service-Testsvc140.csar";
28     private Path tempDirectoryPath;
29
30     @Rule
31     public TemporaryFolder folder = new TemporaryFolder();
32
33     @Autowired
34     private ListenerServiceImpl listenerService;
35
36     @Test
37     public void extractBluePrintSuccessfully() {
38         // Arrange
39         tempDirectoryPath = Paths.get(folder.getRoot().toString(), "cds-sdc-listener-test");
40
41         // Act
42         listenerService.extractBluePrint(CSAR_SAMPLE, tempDirectoryPath.toString());
43     }
44 }