springboot(springCloud)启动的时候指定启动环境


import javax.sound.midi.SoundbankResource;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = StarterApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("dev")
public class TestRed {
    @Autowired
    private IFreeOrderService freeOrderService;
    @Test
    public  void testMethod(){
        System.out.println("method to test");
        freeOrderService.getUserFreeOrderLimitWithCache(null);
    }


}

@ActiveProfiles("dev") 指定dev作为启动环境

你可能感兴趣的:(java)