@Test public void buildUrl_insecureMode_doAsUserQueryParam() throws Exception { final String principalUser = "user"; List<ComponentProcess> componentProcesses = buildUiComponentProcesses(); new Expectations() {{ securityContext.getAuthenticationScheme(); result = StreamlineSecurityContext.KERBEROS_AUTH; securityContext.getUserPrincipal().getName(); result = principalUser; environmentService.listComponentProcesses(stormUi.getId()); result = componentProcesses; }}; final StormMetadataService stormMetadataService = new StormMetadataService .Builder(environmentService, 1L, securityContext, subject).build(); final String tpSumUrl = stormMetadataService.getTopologySummaryUrl(); Assert.assertTrue(tpSumUrl.equals(STORM_UI_URL_EXPECTED +"?" + StormMetadataService.STORM_REST_API_DO_AS_USER_QUERY_PARAM + "=" + principalUser)); }
public String getTopologySummaryUrl() { return tplgySumUrl; }
StormMetadataService { public String getTopologySummaryUrl() { return tplgySumUrl; } }
StormMetadataService { public String getTopologySummaryUrl() { return tplgySumUrl; } StormMetadataService(Client httpClient, String tplgySumUrl, String mainPageUrl,
            SecurityContext securityContext, ServiceConfiguration stormEnvConfig, Subject subject,
                                Component nimbus, Collection<ComponentProcess> nimbusProcesses,
                                Component stormUi, Collection<ComponentProcess> stormUiProcesses); }
StormMetadataService { public String getTopologySummaryUrl() { return tplgySumUrl; } StormMetadataService(Client httpClient, String tplgySumUrl, String mainPageUrl,
            SecurityContext securityContext, ServiceConfiguration stormEnvConfig, Subject subject,
                                Component nimbus, Collection<ComponentProcess> nimbusProcesses,
                                Component stormUi, Collection<ComponentProcess> stormUiProcesses); StormTopologies getTopologies(); String getMainPageUrl(); String getTopologySummaryUrl(); Keytabs getKeytabs(); Principals getPrincipals(); Security getSecurity(); }
StormMetadataService { public String getTopologySummaryUrl() { return tplgySumUrl; } StormMetadataService(Client httpClient, String tplgySumUrl, String mainPageUrl,
            SecurityContext securityContext, ServiceConfiguration stormEnvConfig, Subject subject,
                                Component nimbus, Collection<ComponentProcess> nimbusProcesses,
                                Component stormUi, Collection<ComponentProcess> stormUiProcesses); StormTopologies getTopologies(); String getMainPageUrl(); String getTopologySummaryUrl(); Keytabs getKeytabs(); Principals getPrincipals(); Security getSecurity(); static final String STORM_REST_API_DO_AS_USER_QUERY_PARAM; static final String SERVICE_STORM_VIEW; static final String STORM_VIEW_CONFIGURATION_KEY_STORM_VIEW_URL; }