package com.pannk.demo.service.impl;

import com.pannk.demo.service.CallService;
import com.pannk.demo.service.HelloService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.BDDMockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Created by wolf on 20-11-10.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class CallServiceImplTest {

    @MockBean
    private HelloService helloService;
    @Autowired
    private CallService mainService;

    @Test
    public void testCall(){
        BDDMockito.given(this.helloService.hello()).willReturn("hello world");
        mainService.call();
    }
}
