All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.leopard.test.mock.MockStatic Maven / Gradle / Ivy

The newest version!
package io.leopard.test.mock;

import java.util.Map;

public class MockStatic {
	private static final ThreadLocal> STATIC_CLASS_MAPPING = new ThreadLocal>();

	public static String getStaticClassName(String classSimpleName) {
		Map map = STATIC_CLASS_MAPPING.get();
		if (map == null) {
			throw new NullPointerException("您还没有在@PrepareForTest加入[" + classSimpleName + ".class].");
		}
		return map.get(classSimpleName);
	}

	public static void setStaticClassName(Map mapping) {
		STATIC_CLASS_MAPPING.set(mapping);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy