@Test public void shouldReturnTenantData() throws Exception { UserCheTenantData expectedTenantData = new UserCheTenantData("namespace", "clusterUrl", "routePrefix", false); when(cacheLoader.load(any())).thenReturn(expectedTenantData); UserCheTenantData actualTenantData = tenantDataProvider.getUserCheTenantData(subject, NAMESPACE_TYPE); assertEquals(actualTenantData.getClusterUrl(), expectedTenantData.getClusterUrl()); assertEquals(actualTenantData.getNamespace(), expectedTenantData.getNamespace()); assertEquals(actualTenantData.getRouteBaseSuffix(), expectedTenantData.getRouteBaseSuffix()); assertEquals( actualTenantData.isClusterCapacityExhausted(), expectedTenantData.isClusterCapacityExhausted()); }
public UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType) throws InfrastructureException { if (standalone) { return getDataStandalone(namespaceType); } checkSubject(subject); String keycloakToken = subject.getToken(); try { return tenantDataCache.get(new TenantDataCacheKey(keycloakToken, namespaceType)); } catch (ExecutionException e) { throw new InfrastructureException( "Exception during the user tenant data retrieval or parsing", e.getCause()); } }
TenantDataProvider { public UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType) throws InfrastructureException { if (standalone) { return getDataStandalone(namespaceType); } checkSubject(subject); String keycloakToken = subject.getToken(); try { return tenantDataCache.get(new TenantDataCacheKey(keycloakToken, namespaceType)); } catch (ExecutionException e) { throw new InfrastructureException( "Exception during the user tenant data retrieval or parsing", e.getCause()); } } }
TenantDataProvider { public UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType) throws InfrastructureException { if (standalone) { return getDataStandalone(namespaceType); } checkSubject(subject); String keycloakToken = subject.getToken(); try { return tenantDataCache.get(new TenantDataCacheKey(keycloakToken, namespaceType)); } catch (ExecutionException e) { throw new InfrastructureException( "Exception during the user tenant data retrieval or parsing", e.getCause()); } } @Inject  TenantDataProvider(
      TenantDataCacheLoader tenantDataCacheLoader,
      @Named("che.infra.openshift.project") String cheNamespace,
      @Named("che.fabric8.standalone") boolean standalone); }
TenantDataProvider { public UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType) throws InfrastructureException { if (standalone) { return getDataStandalone(namespaceType); } checkSubject(subject); String keycloakToken = subject.getToken(); try { return tenantDataCache.get(new TenantDataCacheKey(keycloakToken, namespaceType)); } catch (ExecutionException e) { throw new InfrastructureException( "Exception during the user tenant data retrieval or parsing", e.getCause()); } } @Inject  TenantDataProvider(
      TenantDataCacheLoader tenantDataCacheLoader,
      @Named("che.infra.openshift.project") String cheNamespace,
      @Named("che.fabric8.standalone") boolean standalone); UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType); }
TenantDataProvider { public UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType) throws InfrastructureException { if (standalone) { return getDataStandalone(namespaceType); } checkSubject(subject); String keycloakToken = subject.getToken(); try { return tenantDataCache.get(new TenantDataCacheKey(keycloakToken, namespaceType)); } catch (ExecutionException e) { throw new InfrastructureException( "Exception during the user tenant data retrieval or parsing", e.getCause()); } } @Inject  TenantDataProvider(
      TenantDataCacheLoader tenantDataCacheLoader,
      @Named("che.infra.openshift.project") String cheNamespace,
      @Named("che.fabric8.standalone") boolean standalone); UserCheTenantData getUserCheTenantData(Subject subject, String namespaceType);  }