@Test public void testGetLicenseByNameUnresolved() { FailedRequestException exception = new FailedRequestException("get_license", HttpConstants.STATUS_ERR_NOT_FOUND); when(licenseClient.getLicenseByName(LICENSE_NAME)) .thenReturn(FutureUtils.failedFuture(exception)); Optional<SW360License> result = block(licenseClientAdapter.getLicenseByName(LICENSE_NAME)); assertThat(result).isEmpty(); }
@Override public CompletableFuture<Optional<SW360License>> getLicenseByName(String license) { return optionalFuture(getLicenseClient().getLicenseByName(license)); }
SW360LicenseClientAdapterAsyncImpl implements SW360LicenseClientAdapterAsync { @Override public CompletableFuture<Optional<SW360License>> getLicenseByName(String license) { return optionalFuture(getLicenseClient().getLicenseByName(license)); } }
SW360LicenseClientAdapterAsyncImpl implements SW360LicenseClientAdapterAsync { @Override public CompletableFuture<Optional<SW360License>> getLicenseByName(String license) { return optionalFuture(getLicenseClient().getLicenseByName(license)); } SW360LicenseClientAdapterAsyncImpl(SW360LicenseClient client); }
SW360LicenseClientAdapterAsyncImpl implements SW360LicenseClientAdapterAsync { @Override public CompletableFuture<Optional<SW360License>> getLicenseByName(String license) { return optionalFuture(getLicenseClient().getLicenseByName(license)); } SW360LicenseClientAdapterAsyncImpl(SW360LicenseClient client); @Override SW360LicenseClient getLicenseClient(); @Override CompletableFuture<List<SW360SparseLicense>> getLicenses(); @Override CompletableFuture<Optional<SW360License>> getLicenseByName(String license); @Override CompletableFuture<SW360License> enrichSparseLicense(SW360SparseLicense sparseLicense); @Override CompletableFuture<SW360License> createLicense(SW360License license); }
SW360LicenseClientAdapterAsyncImpl implements SW360LicenseClientAdapterAsync { @Override public CompletableFuture<Optional<SW360License>> getLicenseByName(String license) { return optionalFuture(getLicenseClient().getLicenseByName(license)); } SW360LicenseClientAdapterAsyncImpl(SW360LicenseClient client); @Override SW360LicenseClient getLicenseClient(); @Override CompletableFuture<List<SW360SparseLicense>> getLicenses(); @Override CompletableFuture<Optional<SW360License>> getLicenseByName(String license); @Override CompletableFuture<SW360License> enrichSparseLicense(SW360SparseLicense sparseLicense); @Override CompletableFuture<SW360License> createLicense(SW360License license);  }