chore: add demo profile and local api proxy
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.linhelp.dev;
|
||||
|
||||
import com.linhelp.delivery.DeliveryUserService;
|
||||
import com.linhelp.groupbuy.GroupBuyService;
|
||||
import com.linhelp.notice.BannerService;
|
||||
import com.linhelp.notice.NoticeService;
|
||||
import com.linhelp.product.ProductService;
|
||||
import com.linhelp.secondhand.SecondGoodsService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@SpringBootTest(properties = {
|
||||
"spring.flyway.enabled=false",
|
||||
"spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration"
|
||||
})
|
||||
class DevDataInitializerTests {
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
@Autowired
|
||||
private GroupBuyService groupBuyService;
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
@Autowired
|
||||
private BannerService bannerService;
|
||||
@Autowired
|
||||
private SecondGoodsService secondGoodsService;
|
||||
@Autowired
|
||||
private DeliveryUserService deliveryUserService;
|
||||
|
||||
@Test
|
||||
void seedsOneCommunityDemoDataForLocalTrial() {
|
||||
assertThat(productService.listCategories(1L, true)).hasSize(6);
|
||||
assertThat(productService.listMini(1L, null)).hasSizeGreaterThanOrEqualTo(10);
|
||||
assertThat(groupBuyService.listMini(1L)).hasSize(1);
|
||||
assertThat(noticeService.listPublished(1L)).hasSize(2);
|
||||
assertThat(bannerService.listEnabled(1L)).hasSize(1);
|
||||
assertThat(secondGoodsService.listPublic(1L, null)).hasSize(1);
|
||||
assertThat(deliveryUserService.requireByUserId(3L).getName()).isEqualTo("配送员小林");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user