Skip to content

Commit

Permalink
[PRDP-220] Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svariant committed Nov 17, 2023
1 parent 74f9d7a commit 61acf3f
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
@ExtendWith(MockitoExtension.class)
class BizEventToReceiptTest {
public static final String HTTP_MESSAGE_ERROR = "an error occured";
public static final String RECEIPT_ID = "receipt_id";
private final String PAYER_FISCAL_CODE = "a valid payer CF";
private final String DEBTOR_FISCAL_CODE = "a valid debtor CF";
private final String TOKENIZED_DEBTOR_FISCAL_CODE = "tokenizedDebtorFiscalCode";
Expand All @@ -62,9 +61,6 @@ void runOk() throws PDVTokenizerException, JsonProcessingException {

CosmosItemResponse<Receipt> cosmosResponse = mock(CosmosItemResponse.class);
when(cosmosResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value());
Receipt cosmosMockReceipt = new Receipt();
cosmosMockReceipt.setId(RECEIPT_ID);
when(cosmosResponse.getItem()).thenReturn(cosmosMockReceipt);
when(receiptCosmosClient.saveReceipts(any(Receipt.class))).thenReturn(cosmosResponse);

Response<SendMessageResult> response = mock(Response.class);
Expand Down Expand Up @@ -97,9 +93,6 @@ void runOkTotalNoticeNull() throws PDVTokenizerException, JsonProcessingExceptio

CosmosItemResponse<Receipt> cosmosResponse = mock(CosmosItemResponse.class);
when(cosmosResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value());
Receipt cosmosMockReceipt = new Receipt();
cosmosMockReceipt.setId(RECEIPT_ID);
when(cosmosResponse.getItem()).thenReturn(cosmosMockReceipt);
when(receiptCosmosClient.saveReceipts(any(Receipt.class))).thenReturn(cosmosResponse);

BizEventToReceiptServiceImpl receiptService = new BizEventToReceiptServiceImpl(pdvTokenizerServiceMock, receiptCosmosClient, queueClient);
Expand Down Expand Up @@ -226,7 +219,6 @@ void errorAddingMessageToQueue() throws PDVTokenizerException, JsonProcessingExc

CosmosItemResponse<Receipt> cosmosResponse = mock(CosmosItemResponse.class);
when(cosmosResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value());
when(cosmosResponse.getItem()).thenReturn(new Receipt());
when(receiptCosmosClient.saveReceipts(any(Receipt.class))).thenReturn(cosmosResponse);

Response<SendMessageResult> response = mock(Response.class);
Expand Down Expand Up @@ -295,9 +287,6 @@ void errorAddingMessageToQueueThrowException() throws Exception {

CosmosItemResponse<Receipt> cosmosResponse = mock(CosmosItemResponse.class);
when(cosmosResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value());
Receipt cosmosMockReceipt = new Receipt();
cosmosMockReceipt.setId(RECEIPT_ID);
when(cosmosResponse.getItem()).thenReturn(cosmosMockReceipt);

when(receiptCosmosClient.saveReceipts(any(Receipt.class))).thenReturn(cosmosResponse);

Expand Down

0 comments on commit 61acf3f

Please sign in to comment.