Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Dec 11, 2024
1 parent 3348f9a commit 8113a4a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.pagopa.selfcare.onboarding.service;

import static it.pagopa.selfcare.onboarding.common.TokenType.ATTACHMENT;
import static it.pagopa.selfcare.onboarding.common.TokenType.INSTITUTION;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -15,6 +16,7 @@
import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.helpers.test.UniAssertSubscriber;
import it.pagopa.selfcare.azurestorage.AzureBlobClient;
import it.pagopa.selfcare.onboarding.common.TokenType;
import it.pagopa.selfcare.onboarding.entity.Token;
import jakarta.inject.Inject;
import java.io.File;
Expand Down Expand Up @@ -52,11 +54,12 @@ void getToken() {
void retrieveContractNotSigned() {
Token token = new Token();
token.setContractFilename("fileName");
token.setType(TokenType.INSTITUTION);
ReactivePanacheQuery queryPage = mock(ReactivePanacheQuery.class);
when(queryPage.firstResult()).thenReturn(Uni.createFrom().item(token));

PanacheMock.mock(Token.class);
when(Token.find("onboardingId", onboardingId))
when(Token.find("onboardingId = ?1 and type = ?2", onboardingId, INSTITUTION.name()))
.thenReturn(queryPage);

when(azureBlobClient.getFileAsPdf(anyString())).thenReturn(new File("fileName"));
Expand Down

0 comments on commit 8113a4a

Please sign in to comment.