Skip to content

Commit

Permalink
fix: IoNotification will receive the map of the iuds correctly synchr…
Browse files Browse the repository at this point in the history
…onized
  • Loading branch information
antonioT90 committed Feb 12, 2025
1 parent 42fd4fc commit a917b93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import io.temporal.activity.ActivityInterface;
import io.temporal.activity.ActivityMethod;
import it.gov.pagopa.pu.debtposition.dto.generated.DebtPositionDTO;
import it.gov.pagopa.pu.debtposition.dto.generated.IupdSyncStatusUpdateDTO;

import java.util.Map;


/**
Expand All @@ -15,10 +18,11 @@ public interface SendDebtPositionIONotificationActivity {
/**
* Sends a notification message for the specified debt position to the IO Notification service.
*
* @param debtPosition the {@link DebtPositionDTO} containing the details of the debt position to be notified.
* @param requestedDebtPosition the {@link DebtPositionDTO} containing the details of the debt position to be notified (as given to the WF).
* @param iupdSyncStatusUpdateDTOMap the map of the correctly synchronized IUD
*/
@ActivityMethod
void sendMessage(DebtPositionDTO debtPosition);
void sendMessage(DebtPositionDTO requestedDebtPosition, Map<String, IupdSyncStatusUpdateDTO> iupdSyncStatusUpdateDTOMap);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import it.gov.pagopa.payhub.activities.connector.ionotification.IONotificationService;
import it.gov.pagopa.pu.debtposition.dto.generated.DebtPositionDTO;
import it.gov.pagopa.pu.debtposition.dto.generated.IupdSyncStatusUpdateDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.Map;

@Lazy
@Service
@Slf4j
Expand All @@ -18,7 +21,7 @@ public SendDebtPositionIONotificationActivityImpl(IONotificationService ioNotifi
}

@Override
public void sendMessage(DebtPositionDTO debtPosition) {
public void sendMessage(DebtPositionDTO debtPosition, Map<String, IupdSyncStatusUpdateDTO> iupdSyncStatusUpdateDTOMap) {
log.info("Sending message to IONotification for debt position type org id {}", debtPosition.getDebtPositionTypeOrgId());
ioNotificationService.sendMessage(debtPosition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void givenSendMessageThenSuccess(){
DebtPositionDTO debtPosition = buildDebtPositionDTO();

// When
activity.sendMessage(debtPosition);
activity.sendMessage(debtPosition, null);

// Then
Mockito.verify(ioNotificationServiceMock, Mockito.times(1))
Expand Down

0 comments on commit a917b93

Please sign in to comment.