// Path: tests/utils/src/main/java/org/powermock/api/mockito/MockitoVersion.java
// public class MockitoVersion {
//     
//     public static boolean isMockito1(){
//         return MOCKITO_VERSION.isMockito1_0();
//     }
// 
//     public static boolean isMockito2(){
//         return MOCKITO_VERSION.isMockito2_0();
//     }
// 
//     public static boolean isMockito3(){
//         return MOCKITO_VERSION.isMockito3_0();
//     }
// 
//     public static boolean isMockito4(){
//         return MOCKITO_VERSION.isMockito4_0();
//     }
// 
//     private static final MockitoVersion MOCKITO_VERSION = new MockitoVersion();
//     
//     private final String version;
//     
//     private MockitoVersion() {
//         String ver = "";
//         try {
//             Class<?> mockitoClass = Class.forName("org.mockito.Mock");
//             ProtectionDomain protectionDomain = mockitoClass.getProtectionDomain();
//             CodeSource codeSource = protectionDomain.getCodeSource();
//             String path = codeSource.getLocation().toString();
//             int x = path.lastIndexOf("-");
//             int y = path.lastIndexOf(".");
//             ver = path.substring(x + 1, y);
//         } catch (Exception e) {
//             ver = "";
//         } finally {
//             version = ver;
//         }
//     }
//     
//     
//     private boolean isMockito1_0() {
//             return version.startsWith("1");
//         }
//     
//     private boolean isMockito2_0() {
//         return version.startsWith("2");
//     }
// 
//     private boolean isMockito3_0() {
//         return version.startsWith("3");
//     }
// 
//     private boolean isMockito4_0() {
//         return version.startsWith("4");
//     }
// }
// 
// Path: powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/PowerMockRunner.java
// public class PowerMockRunner extends AbstractCommonPowerMockRunner {
// 
//     public PowerMockRunner(Class<?> klass) throws Exception {
//         super(klass, getRunnerDelegateImplClass(klass));
//     }
//     
//     private static Class<? extends PowerMockJUnitRunnerDelegate> getRunnerDelegateImplClass(Class<?> klass) {
//         if (klass.isAnnotationPresent(PowerMockRunnerDelegate.class)
//                 || Boolean.getBoolean("powermock.implicitDelegateAnnotation")) {
//             return DelegatingPowerMockRunner.class;
//         }
// 
//         Class<? extends PowerMockJUnitRunnerDelegate> concreteClass = PowerMockJUnit44RunnerDelegateImpl.class;
//         if(JUnitVersion.isGreaterThanOrEqualTo("4.9")) {
//                    concreteClass = PowerMockJUnit49RunnerDelegateImpl.class;
//         } else if( JUnitVersion.isGreaterThanOrEqualTo("4.7") ) {
//             concreteClass = PowerMockJUnit47RunnerDelegateImpl.class;
//         }
//         return concreteClass;
//     }
// 
//     /**
//      * Clean up some state to avoid OOM issues
//      */
//     @Override
//     public void run(RunNotifier notifier) {
//         Description description = getDescription();
//         try {
//             super.run(notifier);
//         } finally {
//             Whitebox.setInternalState(description, "fAnnotations", new Annotation[]{});
//         }
//     }
// }


import static org.mockito.Mockito.when;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.exceptions.verification.NoInteractionsWanted;
import org.powermock.api.mockito.MockitoVersion;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.assertj.core.api.Java6Assertions.assertThat;
import static org.assertj.core.api.Java6Assertions.assertThatThrownBy;
import static org.junit.Assume.assumeTrue;
/*
 *
 *   Copyright 2017 the original author or authors.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package samples.powermockito.inline.bugs.github793;



@RunWith(PowerMockRunner.class)
@PrepareForTest(StaticClass.class)
public class PowerMockStaticMockingTest {
    
    @Test
    public void should_mock_static_method_when_mockito_inline_mock_creator_for_mockito_tests() {

        assumeTrue("Test makes sense only for Mockito 2 & 3 & 4",
// Path: tests/utils/src/main/java/org/powermock/api/mockito/MockitoVersion.java
// public class MockitoVersion {
//     
//     public static boolean isMockito1(){
//         return MOCKITO_VERSION.isMockito1_0();
//     }
// 
//     public static boolean isMockito2(){
//         return MOCKITO_VERSION.isMockito2_0();
//     }
// 
//     public static boolean isMockito3(){
//         return MOCKITO_VERSION.isMockito3_0();
//     }
// 
//     public static boolean isMockito4(){
//         return MOCKITO_VERSION.isMockito4_0();
//     }
// 
//     private static final MockitoVersion MOCKITO_VERSION = new MockitoVersion();
//     
//     private final String version;
//     
//     private MockitoVersion() {
//         String ver = "";
//         try {
//             Class<?> mockitoClass = Class.forName("org.mockito.Mock");
//             ProtectionDomain protectionDomain = mockitoClass.getProtectionDomain();
//             CodeSource codeSource = protectionDomain.getCodeSource();
//             String path = codeSource.getLocation().toString();
//             int x = path.lastIndexOf("-");
//             int y = path.lastIndexOf(".");
//             ver = path.substring(x + 1, y);
//         } catch (Exception e) {
//             ver = "";
//         } finally {
//             version = ver;
//         }
//     }
//     
//     
//     private boolean isMockito1_0() {
//             return version.startsWith("1");
//         }
//     
//     private boolean isMockito2_0() {
//         return version.startsWith("2");
//     }
// 
//     private boolean isMockito3_0() {
//         return version.startsWith("3");
//     }
// 
//     private boolean isMockito4_0() {
//         return version.startsWith("4");
//     }
// }
// 
// Path: powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/PowerMockRunner.java
// public class PowerMockRunner extends AbstractCommonPowerMockRunner {
// 
//     public PowerMockRunner(Class<?> klass) throws Exception {
//         super(klass, getRunnerDelegateImplClass(klass));
//     }
//     
//     private static Class<? extends PowerMockJUnitRunnerDelegate> getRunnerDelegateImplClass(Class<?> klass) {
//         if (klass.isAnnotationPresent(PowerMockRunnerDelegate.class)
//                 || Boolean.getBoolean("powermock.implicitDelegateAnnotation")) {
//             return DelegatingPowerMockRunner.class;
//         }
// 
//         Class<? extends PowerMockJUnitRunnerDelegate> concreteClass = PowerMockJUnit44RunnerDelegateImpl.class;
//         if(JUnitVersion.isGreaterThanOrEqualTo("4.9")) {
//                    concreteClass = PowerMockJUnit49RunnerDelegateImpl.class;
//         } else if( JUnitVersion.isGreaterThanOrEqualTo("4.7") ) {
//             concreteClass = PowerMockJUnit47RunnerDelegateImpl.class;
//         }
//         return concreteClass;
//     }
// 
//     /**
//      * Clean up some state to avoid OOM issues
//      */
//     @Override
//     public void run(RunNotifier notifier) {
//         Description description = getDescription();
//         try {
//             super.run(notifier);
//         } finally {
//             Whitebox.setInternalState(description, "fAnnotations", new Annotation[]{});
//         }
//     }
// }


// Path: tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/PowerMockStaticMockingTest.java
import static org.mockito.Mockito.when;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.exceptions.verification.NoInteractionsWanted;
import org.powermock.api.mockito.MockitoVersion;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.assertj.core.api.Java6Assertions.assertThat;
import static org.assertj.core.api.Java6Assertions.assertThatThrownBy;
import static org.junit.Assume.assumeTrue;

/*
 *
 *   Copyright 2017 the original author or authors.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package samples.powermockito.inline.bugs.github793;



@RunWith(PowerMockRunner.class)
@PrepareForTest(StaticClass.class)
public class PowerMockStaticMockingTest {
    
    @Test
    public void should_mock_static_method_when_mockito_inline_mock_creator_for_mockito_tests() {

        assumeTrue("Test makes sense only for Mockito 2 & 3 & 4",
                MockitoVersion.isMockito2() || MockitoVersion.isMockito3() || MockitoVersion.isMockito4());