Utils { protected static String createBasicAuthorizationHeader(String clientId, String clientSecret) { try { log.debug("Starting to create basic authorization header value."); String usernameAndPassword = String.format( "%s:%s", clientId, clientSecret); String base64UsernameAndPassword = Base64.getEncoder().encodeToString(usernameAndPassword.getBytes()); String basicAuthHeader = String.format("Basic %s", base64UsernameAndPassword); return basicAuthHeader; } catch (Exception ex) { String errMsg = String.format( "Error creating basic authorization header value., Message: %s", ex.getMessage()); log.error(errMsg, ex); throw ex; } finally { log.debug("Finished creating basic authorization header value."); } }  static Boolean isURIValid(String str); static Boolean isNullOrEmpty(String str); static String createBearerHeader(String accessToken);  }
@Test public void createBasicAuthorizationHeader() { assertNotNull(Utils.createBasicAuthorizationHeader("clientId", "clientSecret")); }