|
@@ -49,10 +49,10 @@ public class ProductControllerTest {
|
|
|
mockResult.put("page", 1);
|
|
mockResult.put("page", 1);
|
|
|
mockResult.put("size", 10);
|
|
mockResult.put("size", 10);
|
|
|
|
|
|
|
|
- when(productService.list(any(ProductListQueryDTO.class), isNull()))
|
|
|
|
|
|
|
+ when(productService.list(any(ProductListQueryDTO.class), isNull(), any()))
|
|
|
.thenReturn(Result.success(mockResult));
|
|
.thenReturn(Result.success(mockResult));
|
|
|
|
|
|
|
|
- Result<Map<String, Object>> result = controller.list(query, null);
|
|
|
|
|
|
|
+ Result<Map<String, Object>> result = controller.list(query, null, "admin");
|
|
|
|
|
|
|
|
assertEquals(200, result.getCode());
|
|
assertEquals(200, result.getCode());
|
|
|
assertNotNull(result.getData());
|
|
assertNotNull(result.getData());
|
|
@@ -76,10 +76,10 @@ public class ProductControllerTest {
|
|
|
mockResult.put("page", 1);
|
|
mockResult.put("page", 1);
|
|
|
mockResult.put("size", 10);
|
|
mockResult.put("size", 10);
|
|
|
|
|
|
|
|
- when(productService.list(any(ProductListQueryDTO.class), isNull()))
|
|
|
|
|
|
|
+ when(productService.list(any(ProductListQueryDTO.class), isNull(), any()))
|
|
|
.thenReturn(Result.success(mockResult));
|
|
.thenReturn(Result.success(mockResult));
|
|
|
|
|
|
|
|
- Result<Map<String, Object>> result = controller.list(query, null);
|
|
|
|
|
|
|
+ Result<Map<String, Object>> result = controller.list(query, null, "admin");
|
|
|
|
|
|
|
|
assertEquals(200, result.getCode());
|
|
assertEquals(200, result.getCode());
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
@@ -100,10 +100,10 @@ public class ProductControllerTest {
|
|
|
));
|
|
));
|
|
|
mockResult.put("total", 1L);
|
|
mockResult.put("total", 1L);
|
|
|
|
|
|
|
|
- when(productService.list(any(ProductListQueryDTO.class), isNull()))
|
|
|
|
|
|
|
+ when(productService.list(any(ProductListQueryDTO.class), isNull(), any()))
|
|
|
.thenReturn(Result.success(mockResult));
|
|
.thenReturn(Result.success(mockResult));
|
|
|
|
|
|
|
|
- Result<Map<String, Object>> result = controller.list(query, null);
|
|
|
|
|
|
|
+ Result<Map<String, Object>> result = controller.list(query, null, "admin");
|
|
|
|
|
|
|
|
assertEquals(200, result.getCode());
|
|
assertEquals(200, result.getCode());
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
@@ -122,10 +122,10 @@ public class ProductControllerTest {
|
|
|
mockResult.put("records", Collections.emptyList());
|
|
mockResult.put("records", Collections.emptyList());
|
|
|
mockResult.put("total", 0L);
|
|
mockResult.put("total", 0L);
|
|
|
|
|
|
|
|
- when(productService.list(any(ProductListQueryDTO.class), isNull()))
|
|
|
|
|
|
|
+ when(productService.list(any(ProductListQueryDTO.class), isNull(), any()))
|
|
|
.thenReturn(Result.success(mockResult));
|
|
.thenReturn(Result.success(mockResult));
|
|
|
|
|
|
|
|
- Result<Map<String, Object>> result = controller.list(query, null);
|
|
|
|
|
|
|
+ Result<Map<String, Object>> result = controller.list(query, null, "admin");
|
|
|
|
|
|
|
|
assertEquals(200, result.getCode());
|
|
assertEquals(200, result.getCode());
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|