Skip to content

Commit

Permalink
PFM-4509
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Sep 7, 2023
1 parent c99a882 commit ece9b9f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core-services/egov-pg-service/src/test/java/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Test {

@Before
public void setUp() {
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("pb").emailId("").build();
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("br").emailId("").build();
this.restTemplate = new RestTemplate();
this.objectMapper = new ObjectMapper();
this.environment = new MockEnvironment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void setUp() {
public void testIdGen() {

RequestInfo requestInfo = new RequestInfo("", "", 0L, "", "", "", "", "", "8e88988e-d342-45c2-81d0-487a2a20350e", null);
IdGenerationResponse response = idGenRepository.getId(requestInfo, "pb", "pg.txnid",
IdGenerationResponse response = idGenRepository.getId(requestInfo, "br", "pg.txnid",
"" +
"PB-PG-[cy:yyyy/MM/dd]-[SEQ_EG_PG_TXN]-[d{2}]", 1);
System.out.println(response.getIdResponses());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class TransactionServiceTest {

@Before
public void setUp() {
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("pb").emailId("").build();
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("br").emailId("").build();
requestInfo = new RequestInfo("", "", 0L, "", "", "", "", "", "", null);
lenient().when(gatewayService.getTxnId(any(Map.class))).thenReturn(Optional.of("ORDERID"));
lenient().doNothing().when(producer).push(any(String.class), any(Object.class));
Expand Down Expand Up @@ -156,12 +156,12 @@ public void initiateTransactionSkipGatewayTest(){
public void getTransactionsSuccessTest(){
Transaction txn = Transaction.builder().txnId("PT_001")
.txnAmount("100")
.tenantId("pb")
.tenantId("br")
.billId("ORDER0012")
.productInfo("Property Tax Payment")
.gateway("ABCD123")
.build();
TransactionCriteria criteria = TransactionCriteria.builder().tenantId("pb").txnId("PT_001").build();
TransactionCriteria criteria = TransactionCriteria.builder().tenantId("br").txnId("PT_001").build();

when(transactionRepository.fetchTransactions(criteria)).thenReturn(Collections.singletonList(txn));
assertEquals(1, transactionService.getTransactions(criteria).size());
Expand All @@ -175,7 +175,7 @@ public void getTransactionsSuccessTest(){
*/
@Test(expected = CustomException.class)
public void getTransactionsFailTest(){
TransactionCriteria criteria = TransactionCriteria.builder().tenantId("pb").txnId("PT_001").build();
TransactionCriteria criteria = TransactionCriteria.builder().tenantId("br").txnId("PT_001").build();
when(transactionRepository.fetchTransactions(criteria)).thenThrow(new TransientDataAccessResourceException("test"));

transactionService.getTransactions(criteria);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class TransactionsApiControllerTest {

@Before
public void setUp() {
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("pb").emailId("").build();
user = User.builder().userName("USER001").mobileNumber("9XXXXXXXXX").name("XYZ").tenantId("br").emailId("").build();
requestInfo = new RequestInfo("", "", 0L, "", "", "", "", "", "", null);

}
Expand All @@ -82,7 +82,7 @@ public void transactionsV1CreatePostSuccess() throws Exception {
.productInfo("Property Tax Payment")
.gateway("AXIS")
.module("PT")
.tenantId("pb")
.tenantId("br")
.consumerCode("PT-21055")
.taxAndPayments(Collections.singletonList(taxAndPayment))
.callbackUrl("http://2a91377b.ngrok.io/pg-service/payments/v1/_update")
Expand All @@ -105,7 +105,7 @@ public void transactionsV1CreatePostFailure() throws Exception {
.productInfo("Property Tax Payment")
.gateway("AXIS")
.module("PT")
.tenantId("pb")
.tenantId("br")
.callbackUrl("http://2a91377b.ngrok.io/pg-service/payments/v1/_update")
.user(user).build();
when(transactionService.initiateTransaction(any(TransactionRequest.class))).thenReturn(transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public HashMap<String,String> process(MultipartFile file, RequestInfoWrapper req
if (!StringUtils.isEmpty(tenantId)) {
tenantId = tenantId.split("\\.")[0];
} else {
tenantId = "pb";
throw new CustomException("ONBOARD_NOT_FOUND", "Invalid tenantid");
}
user.setTenantId(tenantId);
} else if (2 == address.getColumn()) {
Expand Down

0 comments on commit ece9b9f

Please sign in to comment.