### Question:
LicenseHandler implements LicenseService.Iface { @Override public RequestStatus updateLicense(License license, User user, User requestingUser) throws TException { return handler.updateLicense(license, user, requestingUser); } LicenseHandler(); @Override List<License> getLicenseSummary(); @Override List<License> getLicenseSummaryForExport(); @Override List<License> getDetailedLicenseSummaryForExport(String organisation); @Override List<License> getDetailedLicenseSummary(String organisation, List<String> identifiers); @Override List<LicenseType> addLicenseTypes(List<LicenseType> licenseTypes, User user); @Override List<License> addLicenses(List<License> licenses, User user); @Override List<License> addOrOverwriteLicenses(List<License> licenses, User user); @Override List<Obligation> addListOfObligations(List<Obligation> ListOfObligations, User user); @Override List<LicenseType> getLicenseTypes(); @Override List<License> getLicenses(); @Override List<Obligation> getObligations(); @Override List<LicenseType> getLicenseTypesByIds(List<String> ids); @Override List<Obligation> getObligationsByIds(List<String> ids); @Override License getByID(String id, String organisation); @Override License getByIDWithOwnModerationRequests(String id, String organisation, User user); @Override List<License> getByIds(Set<String> ids, String organisation); @Override LicenseType getLicenseTypeById(String id); @Override Obligation getObligationsById(String id); @Override String addObligations(Obligation obligs, User user); @Override RequestStatus addObligationsToLicense(Obligation obligs, String licenseId, User user); @Override RequestStatus updateLicense(License license, User user, User requestingUser); @Override RequestStatus updateLicenseFromModerationRequest(License licenseAdditions,
                                                            License licenseDeletions,
                                                            User user,
                                                            User requestingUser); @Override RequestStatus updateWhitelist(String licenceId, Set<String> whitelist, User user); @Override RequestStatus deleteLicense(String id, User user); @Override List<CustomProperties> getCustomProperties(String documentType); @Override RequestStatus updateCustomProperties(CustomProperties customProperties, User user); @Override RequestSummary deleteAllLicenseInformation(User user); @Override RequestSummary importAllSpdxLicenses(User user); @Override RequestStatus deleteObligations(String id, User user);  }### Answer:
@Test public void testUpdateLicense() throws Exception { License license = licenses.get("Apache-1.1"); license.setFullname("Fullname of license changed"); RequestStatus status = handler.updateLicense(license, user, user); assertEquals(RequestStatus.SUCCESS, status); License licenseActual = handler.getByID(license.getShortname(), user.getDepartment()); assertEquals("Fullname of license changed", licenseActual.getFullname()); }
@Test(expected = SW360Exception.class) public void testAddLicenseNotValid() throws Exception { License invalidLicense = new License(); invalidLicense.setShortname("Invalid ! License Id ???"); invalidLicense.setFullname("This is a invalid license"); handler.updateLicense(invalidLicense, user, user); }
@Test(expected = SW360Exception.class) public void testUpdateLicenseIdNotMatch() throws Exception { License invalidLicense = licenses.get("Apache-1.1"); invalidLicense.setShortname("Apache-2.0"); handler.updateLicense(invalidLicense, user, user); }