aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java
blob: 37a43aa5295a5dc4bcd81e36fc23c5177a7f0a11 (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
package org.onap.so.db.catalog.data.repository;

import org.junit.Assert;
import org.junit.Test;
import org.onap.so.db.catalog.BaseTest;
import org.onap.so.db.catalog.beans.CloudSite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;

import java.util.List;

public class CloudSiteRepositoryTest extends BaseTest {
    
    @Autowired
    private CloudSiteRepository cloudSiteRepository;
    
    @Test
    public void findByClliAndAicVersionTest() throws Exception {
        CloudSite cloudSite = cloudSiteRepository.findByClliAndCloudVersion("MDT13","2.5");
        Assert.assertNotNull(cloudSite);
        Assert.assertEquals("mtn13",cloudSite.getId());
    }

    @Test
    public void findOneTest() throws Exception {
        CloudSite cloudSite = cloudSiteRepository.findOne("mtn13");
        Assert.assertNotNull(cloudSite);
        Assert.assertEquals("mtn13",cloudSite.getId());
    }

    @Test
    public void findAllTest() throws Exception {
        List<CloudSite> cloudSiteList = cloudSiteRepository.findAll();
        Assert.assertFalse(CollectionUtils.isEmpty(cloudSiteList));
    }

}