Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
angelominisci committed Oct 8, 2024
1 parent a95a76b commit 848a857
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/it/pn/frontend/e2e/rest/RestContact.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.awt.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -47,7 +48,8 @@ public void removeDigitalAddressCourtesyEmail() throws RestContactException {
String url = "https://webapi." + env + ".notifichedigitali.it/address-book/v1/digital-address/courtesy/default/EMAIL";
String response = "";
try {
response = httpClient.sendHttpDeleteRequest(url, this.headers, String.class);
headers.put("Authorization", System.getProperty("token"));
response = httpClient.sendHttpDeleteRequest(url, headers, String.class);
logger.info("Risposta ricevuta: " + response);
logger.info("Indirizzo digitale di cortesia rimosso con successo");
} catch (IOException e) {
Expand All @@ -65,7 +67,8 @@ public void removeDigitalAddressLegalPec() throws RestContactException {
String url = "https://webapi." + env + ".notifichedigitali.it/bff/v1/addresses/LEGAL/default/PEC";
String response = "";
try {
response = httpClient.sendHttpDeleteRequest(url, this.headers, String.class);
headers.put("Authorization", System.getProperty("token"));
response = httpClient.sendHttpDeleteRequest(url, headers, String.class);
logger.info("Risposta ricevuta: " + response);
logger.info("Indirizzo digitale di cortesia rimosso con successo");
} catch (IOException e) {
Expand All @@ -87,7 +90,8 @@ public void removeSpecialContact(DigitalAddress digitalAddress) throws RestDeleg
+ addressType + "/" + digitalAddress.getSenderId() + "/" + channelType;
String response = "";
try {
response = httpClient.sendHttpDeleteRequest(url, this.headers, String.class);
headers.put("Authorization", System.getProperty("token"));
response = httpClient.sendHttpDeleteRequest(url, headers, String.class);
logger.info("Risposta ricevuta: " + response);
logger.info("Indirizzo digitale di 'altri recapiti' rimosso con successo");
} catch (IOException e) {
Expand All @@ -101,7 +105,8 @@ public DigitalAddressResponse getDigitalAddress() throws RestContactException {
httpClientDigitalAddress.setBaseUrlApi("https://webapi." + env + ".notifichedigitali.it");
String url = "/bff/v1/addresses/LEGAL/default/PEC";
try {
DigitalAddressResponse response = httpClientDigitalAddress.sendHttpGetRequest(url, this.headers, DigitalAddressResponse.class);
headers.put("Authorization", System.getProperty("token"));
DigitalAddressResponse response = httpClientDigitalAddress.sendHttpGetRequest(url, headers, DigitalAddressResponse.class);
logger.info("Risposta ricevuta: " + response);
logger.info("Indirizzi digitali ricevuti con successo");
return response;
Expand All @@ -119,7 +124,8 @@ public List<DigitalAddress> getAllDigitalAddress() throws RestContactException {
String url = "/bff/v1/addresses";

try {
List<DigitalAddress> response = httpClientDigitalAddress.sendHttpGetRequestListDigitalAddress(url, this.headers, DigitalAddress.class);
headers.put("Authorization", System.getProperty("token"));
List<DigitalAddress> response = httpClientDigitalAddress.sendHttpGetRequestListDigitalAddress(url, headers, DigitalAddress.class);

logger.info("Risposta ricevuta: " + response);
logger.info("Indirizzi digitali ricevuti con successo");
Expand Down

0 comments on commit 848a857

Please sign in to comment.