Non-static field 'meetingNavPstService' cannot be referenced from a static context

单元测试的时候把service方法放入main方法编译报错:把自己坑了一把 

public static void main(String[] args) {
        xxxxService.save(1); 
}

正确的姿势:

@Test
public void Test(){
     xxxxxxService.save(1);
}

猜你喜欢

转载自blog.csdn.net/hqbootstrap1/article/details/84785773
今日推荐