@Test void testFetchJwtBundles() { JwtBundleSet jwtBundleSet = null; try { jwtBundleSet = workloadApiClient.fetchJwtBundles(); } catch (JwtBundleException e) { fail(e); } assertNotNull(jwtBundleSet); try { JwtBundle bundle = jwtBundleSet.getBundleForTrustDomain(TrustDomain.of("example.org")); assertNotNull(bundle); assertEquals(3, bundle.getJwtAuthorities().size()); } catch (BundleNotFoundException e) { fail(e); } }
@Override public JwtBundleSet fetchJwtBundles() throws JwtBundleException { try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(this::callFetchBundles); } catch (Exception e) { throw new JwtBundleException("Error fetching JWT Bundles", e); } }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtBundleSet fetchJwtBundles() throws JwtBundleException { try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(this::callFetchBundles); } catch (Exception e) { throw new JwtBundleException("Error fetching JWT Bundles", e); } } }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtBundleSet fetchJwtBundles() throws JwtBundleException { try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(this::callFetchBundles); } catch (Exception e) { throw new JwtBundleException("Error fetching JWT Bundles", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtBundleSet fetchJwtBundles() throws JwtBundleException { try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(this::callFetchBundles); } catch (Exception e) { throw new JwtBundleException("Error fetching JWT Bundles", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); static WorkloadApiClient newClient(); static WorkloadApiClient newClient(@NonNull final ClientOptions options); @Override X509Context fetchX509Context(); @Override void watchX509Context(@NonNull final Watcher<X509Context> watcher); @Override JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience); @Override JwtSvid fetchJwtSvid(@NonNull final SpiffeId subject,
                                @NonNull final String audience,
                                final String... extraAudience); @Override JwtBundleSet fetchJwtBundles(); @Override JwtSvid validateJwtSvid(@NonNull final String token, @NonNull final String audience); @Override void watchJwtBundles(@NonNull final Watcher<JwtBundleSet> watcher); @Override void close(); }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtBundleSet fetchJwtBundles() throws JwtBundleException { try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(this::callFetchBundles); } catch (Exception e) { throw new JwtBundleException("Error fetching JWT Bundles", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); static WorkloadApiClient newClient(); static WorkloadApiClient newClient(@NonNull final ClientOptions options); @Override X509Context fetchX509Context(); @Override void watchX509Context(@NonNull final Watcher<X509Context> watcher); @Override JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience); @Override JwtSvid fetchJwtSvid(@NonNull final SpiffeId subject,
                                @NonNull final String audience,
                                final String... extraAudience); @Override JwtBundleSet fetchJwtBundles(); @Override JwtSvid validateJwtSvid(@NonNull final String token, @NonNull final String audience); @Override void watchJwtBundles(@NonNull final Watcher<JwtBundleSet> watcher); @Override void close();  }