LicenseHandler implements LicenseMatcher { public void store(final DbLicense dbLicense) { verityLicenseIsConflictFree(dbLicense); repoHandler.store(dbLicense); } LicenseHandler(final RepositoryHandler repoHandler); void store(final DbLicense dbLicense); List<String> getLicensesNames(final FiltersHolder filters); DbLicense getLicense(final String name); void deleteLicense(final String licName); void approveLicense(final String name, final Boolean approved); DbLicense resolve(final String licenseId); List<License> getLicenses(); Set<DbLicense> resolveLicenses(List<String> licStrings); @Override Set<DbLicense> getMatchingLicenses(String licenseString);  }
@Test public void checkStoreLicense(){ final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class); final LicenseHandler handler = new LicenseHandler(repositoryHandler); final DbLicense dbLicense = new DbLicense(); handler.store(dbLicense); verify(repositoryHandler, times(1)).store(dbLicense); }