x1ongzhu il y a 6 ans
Parent
commit
7e3f531e6f

+ 24 - 0
src/test/java/com/izouma/walkchina/repo/MonthWalkDataRepositoryTest.java

@@ -0,0 +1,24 @@
+package com.izouma.walkchina.repo;
+
+import com.izouma.walkchina.domain.MonthWalkData;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import static org.junit.Assert.*;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class MonthWalkDataRepositoryTest {
+
+    @Autowired
+    private MonthWalkDataRepository monthWalkDataRepository;
+
+    @Test
+    public void findByUserId() {
+        MonthWalkData monthWalkData = monthWalkDataRepository.findByUserId(2904L).get();
+        System.out.println(monthWalkData);
+    }
+}

+ 7 - 0
src/test/java/com/izouma/walkchina/service/UserInfoServiceTest.java

@@ -20,6 +20,8 @@ public class UserInfoServiceTest {
     private UserInfoRepository userInfoRepository;
     @Autowired
     private StorageService     storageService;
+    @Autowired
+    private UserInfoService    userInfoService;
 
     @Test
     public void loadUserByUsername() {
@@ -45,4 +47,9 @@ public class UserInfoServiceTest {
             storageService.uploadFromInputStream(ImageUtils.getInputStream(ImageUtils.makeMarker("location", userInfo.getAvatar()), "png"), "marker/location/" + userInfo.getId() + ".png");
         }
     }
+
+    @Test
+    public void updateUserPrice() {
+        userInfoService.updateUserPrice(userInfoRepository.findById(2232L).get());
+    }
 }