-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c3ff34
commit a480343
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...t/kotlin/it/pagopa/ecommerce/helpdesk/dataproviders/oracle/TransactionDataProviderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package it.pagopa.ecommerce.helpdesk.dataproviders.oracle | ||
|
||
import it.pagopa.ecommerce.helpdesk.dataproviders.TransactionDataProvider | ||
import it.pagopa.generated.ecommerce.helpdesk.model.* | ||
import java.util.stream.Stream | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.params.ParameterizedTest | ||
import org.junit.jupiter.params.provider.Arguments | ||
import org.junit.jupiter.params.provider.MethodSource | ||
|
||
class TransactionDataProviderTest { | ||
|
||
companion object { | ||
@JvmStatic | ||
private fun searchCriteriaMappingTestSource() = | ||
Stream.of( | ||
Arguments.of(SearchTransactionRequestPaymentTokenDto::class.java, "PAYMENT_TOKEN"), | ||
Arguments.of(SearchTransactionRequestRptIdDto::class.java, "RPT_ID"), | ||
Arguments.of( | ||
SearchTransactionRequestTransactionIdDto::class.java, | ||
"TRANSACTION_ID" | ||
), | ||
Arguments.of(SearchTransactionRequestEmailDto::class.java, "USER_EMAIL"), | ||
Arguments.of(SearchTransactionRequestFiscalCodeDto::class.java, "USER_FISCAL_CODE"), | ||
) | ||
} | ||
|
||
@ParameterizedTest | ||
@MethodSource("searchCriteriaMappingTestSource") | ||
fun shouldMapSearchCriteriaType(clazz: Class<*>, searchType: String) { | ||
assertEquals(searchType, TransactionDataProvider.SearchTypeMapping.getSearchType(clazz)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters