aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/pom.xml
blob: a64dbc6eedd2cc025f035863262dabd5acab34e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.onap.so.adapters</groupId>
    <artifactId>etsi-sol003-lcm</artifactId>
    <version>1.6.0-SNAPSHOT</version>
  </parent>
  <artifactId>etsi-sol003-lcm-adapter</artifactId>
  <name>ETSI SOL003 Life Cycle Management Adapter</name>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <so.log.level>DEBUG</so.log.level>
          </systemPropertyVariables>
          <rerunFailingTestsCount>2</rerunFailingTestsCount>
          <parallel>suites</parallel>
          <useUnlimitedThreads>false</useUnlimitedThreads>
          <threadCount>1</threadCount>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.onap.so</groupId>
      <artifactId>common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.onap.so.adapters</groupId>
      <artifactId>etsi-sol003-adapter-common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.onap.so.adapters</groupId>
      <artifactId>etsi-sol003-lcm-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.onap.so.adapters</groupId>
      <artifactId>etsi-sol003-lcm-ext-clients</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.inject</groupId>
      <artifactId>jersey-hk2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
LicenseModelFactory.buildList(2); currentSoftwareProduct = VSPEditorFactory.build({id:'RTRTG454545', vendorId: finalizedLicenseModelList[0].id, vendorName: finalizedLicenseModelList[0].name, onBoardingMethod: 'HEAT'}); softwareProductCategories = CategoryWithSubFactory.buildList(2,{},{quantity: 1}); licenseAgreementList = LicenseAgreementStoreFactory.buildList(2); featureGroupsList = FeatureGroupStoreFactory.buildList(2,{referencingLicenseAgreements:[licenseAgreementList[0].id]}); currentScreen = CurrentScreenFactory.build(); qdata = VspQdataFactory.build(); qschema = SoftwareProductQSchemaFactory.build(qdata); }); it('should mapper exist', () => { expect(mapStateToProps).toBeTruthy(); }); it('should mapper return vsp basic data', () => { const state = { currentScreen, softwareProduct: { softwareProductEditor: { data: currentSoftwareProduct }, softwareProductCategories, softwareProductQuestionnaire: { qdata, qschema }, softwareProductComponents: { componentsList:[] }, softwareProductAttachments: { heatSetup: {} } }, finalizedLicenseModelList, licenseModel: { licenseAgreement: { licenseAgreementList }, featureGroup: { featureGroupsList } } }; const result = mapStateToProps(state); expect(result.currentSoftwareProduct).toBeTruthy(); }); it('vsp landing basic view', () => { const params = { ...currentScreen.props, currentSoftwareProduct, componentsList: VSPComponentsFactory.buildList(2) }; const store = storeCreator(); let vspLandingView = TestUtils.renderIntoDocument( <Provider store={store}> <SoftwareProductLandingPageView {...params}/> </Provider> ); expect(vspLandingView).toBeTruthy(); }); it('vsp licence agreement type change', () => { const params = { ...currentScreen.props, currentSoftwareProduct, componentsList: VSPComponentsFactory.buildList(2) }; const e = { target: { value: 'INTERNAL' }}; const obj = {dummyFunction: x => true}; const store = storeCreator(); let vspLandingView = TestUtils.renderIntoDocument( <Provider store={store}> <SoftwareProductLandingPageView {...params}/> </Provider> ); let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType( vspLandingView, SoftwareProductLandingPageView ); const spy = jest.spyOn(obj, "dummyFunction"); vspLandingViewWrapper.licenceChange(e, currentSoftwareProduct, obj.dummyFunction); expect(spy).toHaveBeenCalled(); expect(currentSoftwareProduct.licenseType).toBe("INTERNAL"); expect(vspLandingViewWrapper).toBeTruthy(); }) it('vsp landing handleOnDragEnter test ', () => { const params = { currentSoftwareProduct, ...currentScreen.props, componentsList: VSPComponentsFactory.buildList(2) }; const store = storeCreator(); let vspLandingView = TestUtils.renderIntoDocument( <Provider store={store}> <SoftwareProductLandingPageView {...params}/> </Provider> ); let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType( vspLandingView, SoftwareProductLandingPageView ); expect(vspLandingView).toBeTruthy(); vspLandingViewWrapper.handleOnDragEnter(false); expect(vspLandingViewWrapper.state.dragging).toEqual(true); }); it('vsp landing handleImportSubmit test ', () => { const params = { ...currentScreen.props, currentSoftwareProduct, componentsList: VSPComponentsFactory.buildList(2), onUploadConfirmation: dummyFunc, onUpload: dummyFunc, onInvalidFileSizeUpload: dummyFunc }; const files = [ { name: 'aaa', size: 123 } ]; const store = storeCreator(); let vspLandingView = TestUtils.renderIntoDocument( <Provider store={store}> <SoftwareProductLandingPageView {...params}/> </Provider> ); let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType( vspLandingView, SoftwareProductLandingPageView ); expect(vspLandingView).toBeTruthy(); vspLandingViewWrapper.handleImportSubmit(files, false); expect(vspLandingViewWrapper.state.dragging).toEqual(false); expect(vspLandingViewWrapper.state.fileName).toEqual(files[0].name); const files1 = [ { name: 'bbb', size: 0 } ]; vspLandingViewWrapper.handleImportSubmit(files1, false); }); it('vsp landing handleImportSubmit with damaged file test ', () => { const params = { currentSoftwareProduct, ...currentScreen.props, componentsList: VSPComponentsFactory.buildList(2), onUploadConfirmation: dummyFunc, onUpload: dummyFunc, onInvalidFileSizeUpload: dummyFunc }; const store = storeCreator(); let vspLandingView = TestUtils.renderIntoDocument( <Provider store={store}> <SoftwareProductLandingPageView {...params}/> </Provider> ); let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType( vspLandingView, SoftwareProductLandingPageView ); expect(vspLandingView).toBeTruthy(); const files = [ { name: 'aaa', size: 0 } ]; vspLandingViewWrapper.handleImportSubmit(files, false); expect(vspLandingViewWrapper.state.dragging).toEqual(false); expect(vspLandingViewWrapper.state.fileName).toEqual(''); }); });