|
|
|
@ -5,6 +5,7 @@ import com.share.help.dao.UserMapper; |
|
|
|
|
import com.share.help.entity.ActivityEntity; |
|
|
|
|
import com.share.help.entity.UserEntity; |
|
|
|
|
import com.share.help.res.account.FindUserRes; |
|
|
|
|
import com.share.help.res.activity.ActivitySimple; |
|
|
|
|
import org.junit.jupiter.api.Assertions; |
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
@ -22,6 +23,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; |
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement; |
|
|
|
|
import org.springframework.web.context.WebApplicationContext; |
|
|
|
|
|
|
|
|
|
import java.sql.Timestamp; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.UUID; |
|
|
|
@ -140,16 +142,22 @@ class HelpApplicationTests { |
|
|
|
|
*/ |
|
|
|
|
@Test |
|
|
|
|
public void testActivity(){ |
|
|
|
|
Assertions.assertNotNull(activityMapper.findOne(1L)); |
|
|
|
|
List<ActivitySimple> activityEntityList=activityMapper.getPage(0,10,"123"); |
|
|
|
|
Assertions.assertTrue(activityEntityList.isEmpty()); |
|
|
|
|
activityEntityList=activityMapper.getPage(0,10,"666"); |
|
|
|
|
Assertions.assertFalse(activityEntityList.isEmpty()); |
|
|
|
|
|
|
|
|
|
Assertions.assertNotNull(activityMapper.count(10,"123")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testAddActivity(){ |
|
|
|
|
ActivityEntity activityEntity=activityMapper.findOne(1L); |
|
|
|
|
for(int i=0;i<20;i++){ |
|
|
|
|
ActivityEntity activityEntity=activityMapper.findOne(25L); |
|
|
|
|
|
|
|
|
|
activityEntity.setActivityId(null); |
|
|
|
|
activityEntity.setSeekHelpTime(new Timestamp(System.currentTimeMillis())); |
|
|
|
|
activityMapper.insert(activityEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|