SW360LicenseClientAdapterAsyncImpl implements SW360LicenseClientAdapterAsync { @Override public CompletableFuture<SW360License> createLicense(SW360License license) { return getLicenseClient().createLicense(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);  }
@Test public void testCreateLicense() { SW360License licenseTemplate = new SW360License() .setFullName("testLicense"); SW360License licenseCreated = new SW360License() .setShortName("createdLicense") .setFullName("testLicense"); when(licenseClient.createLicense(licenseTemplate)) .thenReturn(CompletableFuture.completedFuture(licenseCreated)); SW360License result = block(licenseClientAdapter.createLicense(licenseTemplate)); assertThat(result).isEqualTo(licenseCreated); }