|
|
@@ -1,10 +1,8 @@
|
|
|
package com.izouma.nineth.service;
|
|
|
|
|
|
import com.izouma.nineth.ApplicationTests;
|
|
|
-import com.izouma.nineth.domain.BlindBoxItem;
|
|
|
-import com.izouma.nineth.domain.Order;
|
|
|
-import com.izouma.nineth.repo.BlindBoxItemRepo;
|
|
|
-import com.izouma.nineth.repo.OrderRepo;
|
|
|
+import com.izouma.nineth.domain.*;
|
|
|
+import com.izouma.nineth.repo.*;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
@@ -12,11 +10,21 @@ import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
class AssetServiceTest extends ApplicationTests {
|
|
|
@Autowired
|
|
|
- private OrderRepo orderRepo;
|
|
|
+ private OrderRepo orderRepo;
|
|
|
@Autowired
|
|
|
- private BlindBoxItemRepo blindBoxItemRepo;
|
|
|
+ private BlindBoxItemRepo blindBoxItemRepo;
|
|
|
@Autowired
|
|
|
- private AssetService assetService;
|
|
|
+ private AssetService assetService;
|
|
|
+ @Autowired
|
|
|
+ private CollectionRepo collectionRepo;
|
|
|
+ @Autowired
|
|
|
+ private UserRepo userRepo;
|
|
|
+ @Autowired
|
|
|
+ private CollectionService collectionService;
|
|
|
+ @Autowired
|
|
|
+ private AssetMintService assetMintService;
|
|
|
+ @Autowired
|
|
|
+ private AssetRepo assetRepo;
|
|
|
|
|
|
@Test
|
|
|
void createAsset() {
|
|
|
@@ -37,4 +45,19 @@ class AssetServiceTest extends ApplicationTests {
|
|
|
public void testLock() throws InterruptedException {
|
|
|
assetService.testLock("123", "ddd");
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testCreateAsset() {
|
|
|
+ Order order = orderRepo.findById(4618L).get();
|
|
|
+ Collection collection = collectionRepo.findById(order.getCollectionId()).get();
|
|
|
+ BlindBoxItem blindBoxItem = blindBoxItemRepo.findById(4250L).get();
|
|
|
+ User user = userRepo.findById(order.getUserId()).get();
|
|
|
+ assetService.createAsset(blindBoxItem, user, order.getId(), order.getPrice(), "出售", 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void mint() {
|
|
|
+ Asset asset = assetRepo.findById(4622L).get();
|
|
|
+ assetMintService.mint(asset, 1L);
|
|
|
+ }
|
|
|
}
|