Validate request bodies in controller methods
[portal/ric-dashboard.git] / dashboard / webapp-backend / src / test / java / org / oransc / ric / portal / dashboard / model / ModelTest.java
index 78458d0..067bdcb 100644 (file)
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.oransc.ric.portal.dashboard.DashboardUserManagerTest;
@@ -192,16 +193,14 @@ public class ModelTest extends AbstractModelTest {
 
        @Test
        public void testRicRegionList() {
-               RicRegionList m = new RicRegionList();
+               new RicRegionList();
                List<RicRegion> list = new ArrayList<>();
-               m = new RicRegionList(list);
+               final RicRegionList m = new RicRegionList(list);
                Assert.assertEquals(list, m.getRegions());
                Assert.assertNotNull(m.getSimpleInstances());
-               try {
+               Assertions.assertThrows(UnknownInstanceException.class, () -> {
                        m.getInstance(s1);
-               } catch (UnknownInstanceException ex) {
-                       logger.info("failed as expected: {}", ex.toString());
-               }
+               });
                logger.info(m.toString());
        }