Created
March 18, 2017 16:36
-
-
Save yusufsoysal/47442b5ed1131c88bfff559820836a4e to your computer and use it in GitHub Desktop.
Intellij IDEA JUnit4 Test Class Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.*; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.InjectMocks; | |
import org.mockito.Mock; | |
import org.mockito.runners.MockitoJUnitRunner; | |
#parse("File Header.java") | |
#set($lastIndex = $CLASS_NAME.lastIndexOf(".") + 1) | |
#set($onlyClassName = $CLASS_NAME.substring($lastIndex)) | |
#set($Controller_name = $onlyClassName.substring(0,1).toLowerCase() + $onlyClassName.substring(1)) | |
@RunWith(MockitoJUnitRunner.class) | |
public class ${NAME} { | |
@InjectMocks | |
private ${CLASS_NAME} ${Controller_name}; | |
${BODY} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment