| | |
| | | } |
| | | |
| | | @Test |
| | | void cashQueryShouldApproveWhenProviderReturnsCashStatus() { |
| | | GuideWithdrawal processing = withdrawal("PROCESSING"); |
| | | processing.setCashReqSeqId("CW001"); |
| | | processing.setCashReqDate("20260818"); |
| | | when(stateService.find(20L)).thenReturn(processing); |
| | | when(settlementService.requireApprovedCard(8L, 10)).thenReturn(account()); |
| | | JSONObject queryResponse = new JSONObject(); |
| | | queryResponse.put("resp_code", "00000000"); |
| | | queryResponse.put("cash_status", "S"); |
| | | when(withdrawBiz.query("HF100", "20260818", "CW001")).thenReturn(queryResponse); |
| | | |
| | | service.advance(20L); |
| | | |
| | | verify(stateService).markApproved(20L, null); |
| | | } |
| | | |
| | | @Test |
| | | void cashQueryShouldUseSavedHuiFuSequence() { |
| | | GuideWithdrawal processing = withdrawal("PROCESSING"); |
| | | processing.setCashReqSeqId("CW001"); |
| | | processing.setCashReqDate("20260818"); |
| | | processing.setCashHfSeqId("HF-CASH-1"); |
| | | when(stateService.find(20L)).thenReturn(processing); |
| | | when(settlementService.requireApprovedCard(8L, 10)).thenReturn(account()); |
| | | JSONObject queryResponse = new JSONObject(); |
| | | queryResponse.put("trans_stat", "S"); |
| | | when(withdrawBiz.query("HF100", "20260818", "CW001", "HF-CASH-1")) |
| | | .thenReturn(queryResponse); |
| | | |
| | | service.advance(20L); |
| | | |
| | | verify(withdrawBiz).query("HF100", "20260818", "CW001", "HF-CASH-1"); |
| | | verify(stateService).markApproved(20L, null); |
| | | } |
| | | |
| | | @Test |
| | | void cashQueryBusinessErrorShouldRemainProcessing() { |
| | | GuideWithdrawal processing = withdrawal("PROCESSING"); |
| | | processing.setCashReqSeqId("CW001"); |