package com.izouma.dingdong.contorller;

import com.izouma.dingdong.domain.SysConfig;
import com.izouma.dingdong.repo.SysConfigRepo;
import com.izouma.dingdong.web.SysConfigController;
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;

@SpringBootTest
@RunWith(SpringRunner.class)
public class SysConfigControllerTest {
    @Autowired
    private SysConfigController configController;

    @Autowired
    private SysConfigRepo repo;

    @Test
    public void testSave(){
        SysConfig build = SysConfig.builder()
                .name("commission")
                .desc("平台佣金")
                .type(SysConfig.ValueType.NUMBER)
                .value("0.12")
                .build();

       repo.save(build);
    }

}
