@Test public void validWhenLicenseIsNotEmpty() { User user = createUser(); UserManagementProto.Account account = UserManagementProto.Account.newBuilder().setClouderaManagerLicenseKey(LICENSE).build(); when(umsClient.getAccountDetails(USER_CRN, ACCOUNT_ID, Optional.empty())).thenReturn(account); underTest.validateClouderaManagerLicense(user); verify(umsClient).getAccountDetails(USER_CRN, ACCOUNT_ID, Optional.empty()); }
void validateClouderaManagerLicense(User user) { if (hasNoLicense(user.getUserCrn())) { LOGGER.error("User '{}' doesn't have a valid cloudera manager license.", user.getUserCrn()); throw new RuntimeException("User doesn't have a valid cloudera manager license."); } }
ClouderaManagerLicenseService { void validateClouderaManagerLicense(User user) { if (hasNoLicense(user.getUserCrn())) { LOGGER.error("User '{}' doesn't have a valid cloudera manager license.", user.getUserCrn()); throw new RuntimeException("User doesn't have a valid cloudera manager license."); } } }
ClouderaManagerLicenseService { void validateClouderaManagerLicense(User user) { if (hasNoLicense(user.getUserCrn())) { LOGGER.error("User '{}' doesn't have a valid cloudera manager license.", user.getUserCrn()); throw new RuntimeException("User doesn't have a valid cloudera manager license."); } }  }
ClouderaManagerLicenseService { void validateClouderaManagerLicense(User user) { if (hasNoLicense(user.getUserCrn())) { LOGGER.error("User '{}' doesn't have a valid cloudera manager license.", user.getUserCrn()); throw new RuntimeException("User doesn't have a valid cloudera manager license."); } }   }
ClouderaManagerLicenseService { void validateClouderaManagerLicense(User user) { if (hasNoLicense(user.getUserCrn())) { LOGGER.error("User '{}' doesn't have a valid cloudera manager license.", user.getUserCrn()); throw new RuntimeException("User doesn't have a valid cloudera manager license."); } }    }