2 * Copyright © 2018 IBM.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.apps.controllerblueprints.service.repository;
19 import org.junit.Assert;
20 import org.junit.FixMethodOrder;
21 import org.junit.Test;
22 import org.junit.runner.RunWith;
23 import org.junit.runners.MethodSorters;
24 import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
25 import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;
26 import org.springframework.beans.factory.annotation.Autowired;
27 import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
28 import org.springframework.test.context.ContextConfiguration;
29 import org.springframework.test.context.junit4.SpringRunner;
31 import java.util.Arrays;
32 import java.util.List;
34 * ResourceDictionaryReactRepositoryTest.
36 * @author Brinda Santh
39 @RunWith(SpringRunner.class)
41 @ContextConfiguration(classes = {TestApplication.class})
42 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
43 public class ResourceDictionaryReactRepositoryTest {
46 protected ResourceDictionaryReactRepository resourceDictionaryReactRepository;
49 public void test01FindByNameReact() throws Exception {
50 ResourceDictionary dbResourceDictionary = resourceDictionaryReactRepository.findByName("db-source").block();
51 Assert.assertNotNull("Failed to query React Resource Dictionary by Name", dbResourceDictionary);
55 public void test02FindByNameInReact() throws Exception {
56 List<ResourceDictionary> dbResourceDictionaries =
57 resourceDictionaryReactRepository.findByNameIn(Arrays.asList("db-source")).collectList().block();
58 Assert.assertNotNull("Failed to query React Resource Dictionary by Names", dbResourceDictionaries);
62 public void test03FindByTagsContainingIgnoreCaseReact() throws Exception {
63 List<ResourceDictionary> dbTagsResourceDictionaries =
64 resourceDictionaryReactRepository.findByTagsContainingIgnoreCase("db-source").collectList().block();
65 Assert.assertNotNull("Failed to query React Resource Dictionary by Tags", dbTagsResourceDictionaries);