X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FAbstractControllerTest.java;h=dfc8e1533e2eb933d957521977cfe592fc30b24d;hb=a82f827644fa87b576d9de3f77cb1b78d25d356d;hp=e9aedc47ef88c8c9d81d65d7346425156aa4f177;hpb=53f1fcf033e3a166d7203e0a1c5e0971f9c6bc16;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AbstractControllerTest.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AbstractControllerTest.java index e9aedc47..dfc8e153 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AbstractControllerTest.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AbstractControllerTest.java @@ -54,6 +54,14 @@ public class AbstractControllerTest { @Autowired protected TestRestTemplate restTemplate; + // Because I put the annotations on this parent class, + // must define at least one test here. + @Test + public void beQuietSonar() { + // Silence Sonar warning about missing assertion. + Assertions.assertTrue(logger.isWarnEnabled()); + } + /** * Builds URI from path components and query parameters. * @@ -90,21 +98,12 @@ public class AbstractControllerTest { return builder.build().encode().toUri(); } - // Because I put the annotations on this parent class, - // must define at least one test here. - @Test - public void contextLoads() { - // Silence Sonar warning about missing assertion. - Assertions.assertTrue(logger.isWarnEnabled()); - logger.info("Context loads on mock profile"); - } - - public TestRestTemplate testRestTemplateAdminRole() { + protected TestRestTemplate testRestTemplateAdminRole() { return restTemplate.withBasicAuth(WebSecurityMockConfiguration.TEST_CRED_ADMIN, WebSecurityMockConfiguration.TEST_CRED_ADMIN); } - public TestRestTemplate testRestTemplateStandardRole() { + protected TestRestTemplate testRestTemplateStandardRole() { return restTemplate.withBasicAuth(WebSecurityMockConfiguration.TEST_CRED_STANDARD, WebSecurityMockConfiguration.TEST_CRED_STANDARD); }