1 package org.onap.portal.service;
3 import static org.junit.jupiter.api.Assertions.*;
5 import javax.transaction.Transactional;
6 import org.junit.jupiter.api.Test;
7 import org.junit.runner.RunWith;
8 import org.onap.portal.domain.dto.transport.WidgetCatalogPersonalization;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.boot.test.context.SpringBootTest;
11 import org.springframework.test.context.TestPropertySource;
12 import org.springframework.test.context.junit4.SpringRunner;
14 @RunWith(SpringRunner.class)
17 @TestPropertySource(locations = "classpath:test.properties")
18 class PersUserWidgetServiceTest {
21 private PersUserWidgetService persUserWidgetService;
24 void setPersUserAppValueInvalidWidgetIdDataTest() {
25 WidgetCatalogPersonalization catalog = getWidgetCatalog();
26 catalog.setSelect(true);
28 persUserWidgetService.setPersUserAppValue(1, catalog);
29 }catch (IllegalArgumentException e){
30 assertEquals("widgetId may not be null", e.getMessage());
35 void setPersUserAppValueInvalidSelectDataTest() {
36 WidgetCatalogPersonalization catalog = getWidgetCatalog();
37 catalog.setWidgetId(1L);
39 persUserWidgetService.setPersUserAppValue(1, catalog);
40 }catch (IllegalArgumentException e){
41 assertEquals("select may not be null", e.getMessage());
45 private WidgetCatalogPersonalization getWidgetCatalog(){
46 return new WidgetCatalogPersonalization();