Mockito + PowerMock LinkageError while mocking system class

后端 未结 6 1821
难免孤独
难免孤独 2020-12-12 10:28

I\'ve got such a code snippet:

@RunWith(PowerMockRunner.class)
@PrepareForTest({Thread.class})
public class AllMeasuresDataTest {

@Before
public void setUp(         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 11:21

    Try adding this annotation to your Test class:

    @PowerMockIgnore("javax.management.*")

    Worked for me.

提交回复
热议问题