|
|
@@ -92,7 +92,7 @@ class CfBalanceControllerTest {
|
|
|
view.setMemberId(42L);
|
|
|
when(cfBalanceService.getBalance(42L)).thenReturn(view);
|
|
|
|
|
|
- Result<CfBalanceView> r = controller.balance(7L, null);
|
|
|
+ Result<CfBalanceView> r = controller.balance(7L);
|
|
|
|
|
|
assertEquals(200, r.getCode());
|
|
|
assertEquals(42L, r.getData().getMemberId());
|
|
|
@@ -110,7 +110,7 @@ class CfBalanceControllerTest {
|
|
|
void resolveMemberId_未命中_返回404且不查账本() {
|
|
|
when(familyMemberMapper.selectOne(any())).thenReturn(null);
|
|
|
|
|
|
- Result<CfBalanceView> r = controller.balance(99L, null);
|
|
|
+ Result<CfBalanceView> r = controller.balance(99L);
|
|
|
|
|
|
assertEquals(404, r.getCode());
|
|
|
verify(cfBalanceService, never()).getBalance(anyLong());
|
|
|
@@ -118,7 +118,7 @@ class CfBalanceControllerTest {
|
|
|
|
|
|
@Test
|
|
|
void resolveMemberId_userId非法_返回404() {
|
|
|
- Result<CfBalanceView> r = controller.balance(-1L, null);
|
|
|
+ Result<CfBalanceView> r = controller.balance(-1L);
|
|
|
assertEquals(404, r.getCode());
|
|
|
verify(familyMemberMapper, never()).selectOne(any());
|
|
|
}
|
|
|
@@ -137,7 +137,7 @@ class CfBalanceControllerTest {
|
|
|
view.setExchanged(370);
|
|
|
when(cfBalanceService.getBalance(42L)).thenReturn(view);
|
|
|
|
|
|
- Result<CfBalanceView> r = controller.balance(7L, null);
|
|
|
+ Result<CfBalanceView> r = controller.balance(7L);
|
|
|
CfBalanceView data = r.getData();
|
|
|
|
|
|
assertEquals(200, r.getCode());
|
|
|
@@ -166,7 +166,7 @@ class CfBalanceControllerTest {
|
|
|
raw.setRecords(Collections.singletonList(log));
|
|
|
when(cfBalanceService.getLogs(42L, 1, 20)).thenReturn(raw);
|
|
|
|
|
|
- Result<Page<CfBalanceLogVO>> r = controller.logs(7L, null, 1, 20);
|
|
|
+ Result<Page<CfBalanceLogVO>> r = controller.logs(7L, 1, 20);
|
|
|
|
|
|
assertEquals(200, r.getCode());
|
|
|
Page<CfBalanceLogVO> data = r.getData();
|
|
|
@@ -186,7 +186,7 @@ class CfBalanceControllerTest {
|
|
|
void logs_未命中_返回404且不查流水() {
|
|
|
when(familyMemberMapper.selectOne(any())).thenReturn(null);
|
|
|
|
|
|
- Result<Page<CfBalanceLogVO>> r = controller.logs(99L, null, 1, 20);
|
|
|
+ Result<Page<CfBalanceLogVO>> r = controller.logs(99L, 1, 20);
|
|
|
|
|
|
assertEquals(404, r.getCode());
|
|
|
verify(cfBalanceService, never()).getLogs(anyLong(), anyInt(), anyInt());
|
|
|
@@ -199,7 +199,7 @@ class CfBalanceControllerTest {
|
|
|
raw.setRecords(Collections.emptyList());
|
|
|
when(cfBalanceService.getLogs(42L, 1, 20)).thenReturn(raw);
|
|
|
|
|
|
- Result<Page<CfBalanceLogVO>> r = controller.logs(7L, null, 1, 20);
|
|
|
+ Result<Page<CfBalanceLogVO>> r = controller.logs(7L, 1, 20);
|
|
|
|
|
|
assertEquals(200, r.getCode());
|
|
|
assertNotNull(r.getData().getRecords());
|