전체 글

전체 글

    [PowerMock] Class.class mock 처리하기

    .class에 대해 mock 처리를 해야 할 때가 있다.이럴 때는 역시 파워목!MockGateway.MOCK_GET_CLASS_METHOD를 true로 설정하면 된다. TestCode.javaimport org.powermock.core.MockGateway; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; @PowerMockIgnore({"javax.crypto.*", "net.spy.memcached.*"}) @RunWith(PowerMockRunner.class) public class TestClass { @T..