+ app.setRolesInAAF(true);
+ app.setIsEnabled(true);
+ app.setIsOpen(false);
+ app.setAppName("test");
+ app.setRestUrl("http://localhost:1234");
+ app.setAppBasicAuthUsername("test");
+ app.setAppBasicAuthPassword("xyz");
+ URL u = PowerMockito.mock(URL.class);
+ HttpURLConnection huc = PowerMockito.mock(HttpURLConnection.class);
+ String url = "http://localhost:1234/sessionTimeOuts";
+ PowerMockito.whenNew(URL.class).withArguments(url).thenReturn(u);
+ PowerMockito.whenNew(HttpURLConnection.class).withAnyArguments().thenReturn(huc);
+ PowerMockito.when(huc.getResponseCode()).thenReturn(200);
+ String actual = sessionCommunication.sendGet(app);
+ assertEquals("", actual);
+ }
+
+ @Test
+ public void sendGetConnectionRefusedTest1() throws Exception {
+ OnboardingApp app = new OnboardingApp();
+ app.setRestrictedApp(false);
+ app.setUebKey("test");
+ app.setUebSecret("test");
+ app.setUebTopicName("test");
+ app.setRolesInAAF(true);
+ app.setIsEnabled(true);
+ app.setIsOpen(false);
+ app.setAppName("test");
+ app.setRestUrl("http://localhost:1234");
+ app.setAppBasicAuthUsername("test");
+ app.setAppBasicAuthPassword("");
+ EPApp epApp = new EPApp();
+ epApp.setAppBasicAuthUsername("test");
+ epApp.setAppBasicAuthPassword("xyz1234");
+ PowerMockito.mockStatic(CipherUtil.class);
+ PowerMockito.when(CipherUtil.decryptPKC(Matchers.anyString(),Matchers.anyString())).thenReturn("test");
+ Mockito.when(appsCacheService.getApp(1L)).thenReturn(epApp);