Validate request bodies in controller methods
[portal/ric-dashboard.git] / dashboard / webapp-backend / src / test / java / org / oransc / ric / portal / dashboard / controller / AdminControllerTest.java
index 37ab484..f3f9fad 100644 (file)
@@ -138,12 +138,9 @@ public class AdminControllerTest extends AbstractControllerTest {
                statsDetails.setMetricUrl("https://www.example2-next.com");
                AppStats stNext = testRestTemplateAdminRole().postForObject(uri, statsDetails, AppStats.class);
                Assertions.assertTrue(st.getStatsDetails().getAppId() < stNext.getStatsDetails().getAppId());
-               try {
+               Assertions.assertThrows(RestClientException.class, () -> {
                        testRestTemplateAdminRole().postForObject(uri, statsDetails, AppStats.class);
-                       Assert.assertTrue(false);
-               } catch (RestClientException ex) {
-                       logger.info("Caught exception on create as expected: {}", ex.toString());
-               }
+               });
        }
 
        @Order(3)