GoodsProviderServiceTest.java 1.31 KB
package com.bs.order;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bs.order.entity.GoodsProvider;
import com.bs.order.service.GoodsProviderService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@Slf4j
@SpringBootTest
@ActiveProfiles("local")
public class GoodsProviderServiceTest {
    @Autowired
    private GoodsProviderService goodsProviderService;

    @Test
    public void testInsert() {
        log.info("result:{}",goodsProviderService.insert(GoodsProvider.builder()
                .updatedBy("zhoulm").providerName("供应商名称").address("北京八达岭长城")
                .build()));
    }

    @Test
    public void testUpdate() {
        log.info("result:{}",goodsProviderService.update(GoodsProvider.builder()
                .id(1)
                .updatedBy("zhoulm").providerName("供应商名称1").contactName("张三").contactPhone("15818888888")
                .build()));
    }

    @Test
    public void testListWithPage() {
        log.info("result:{}",goodsProviderService.listWithPage(Page.of(2L,10L,true),
                GoodsProvider.builder().build()));
    }
}