@Test public void createAlert() { String message = "any.message"; String param = "24"; HttpHeaders headers = HeaderUtil.createAlert("myApp", message, param); assertThat(headers.getFirst("X-myApp-alert")).isEqualTo(message); assertThat(headers.getFirst("X-myApp-params")).isEqualTo(param); }
public static HttpHeaders createAlert(String applicationName, String message, String param) { HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-alert", message); try { headers.add("X-" + applicationName + "-params", URLEncoder.encode(param, StandardCharsets.UTF_8.toString())); } catch (UnsupportedEncodingException e) { } return headers; }
HeaderUtil { public static HttpHeaders createAlert(String applicationName, String message, String param) { HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-alert", message); try { headers.add("X-" + applicationName + "-params", URLEncoder.encode(param, StandardCharsets.UTF_8.toString())); } catch (UnsupportedEncodingException e) { } return headers; } }
HeaderUtil { public static HttpHeaders createAlert(String applicationName, String message, String param) { HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-alert", message); try { headers.add("X-" + applicationName + "-params", URLEncoder.encode(param, StandardCharsets.UTF_8.toString())); } catch (UnsupportedEncodingException e) { } return headers; } private  HeaderUtil(); }
HeaderUtil { public static HttpHeaders createAlert(String applicationName, String message, String param) { HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-alert", message); try { headers.add("X-" + applicationName + "-params", URLEncoder.encode(param, StandardCharsets.UTF_8.toString())); } catch (UnsupportedEncodingException e) { } return headers; } private  HeaderUtil(); static HttpHeaders createAlert(String applicationName, String message, String param); static HttpHeaders createEntityCreationAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createEntityUpdateAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createEntityDeletionAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createFailureAlert(String applicationName, boolean enableTranslation, String entityName, String errorKey, String defaultMessage); }
HeaderUtil { public static HttpHeaders createAlert(String applicationName, String message, String param) { HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-alert", message); try { headers.add("X-" + applicationName + "-params", URLEncoder.encode(param, StandardCharsets.UTF_8.toString())); } catch (UnsupportedEncodingException e) { } return headers; } private  HeaderUtil(); static HttpHeaders createAlert(String applicationName, String message, String param); static HttpHeaders createEntityCreationAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createEntityUpdateAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createEntityDeletionAlert(String applicationName, boolean enableTranslation, String entityName, String param); static HttpHeaders createFailureAlert(String applicationName, boolean enableTranslation, String entityName, String errorKey, String defaultMessage);  }