Get to know what is Gradle and build a java project with Gradle step by step and then use gradle add new java library dependence to your project.
- Use Gradle command line to build Java project
- Use Gradle to compile Javap project
- Use Gradle run automatic test
- Use Gradle to add ideaplug-in, and generate Intellj Idea project files
- Use Gradle to run program to output "This is a Gradle Project" to command line
- Add Mockito dependence and simply use Mockito in test method to get test passed
@Test
public void testMockClass() throws Exception {
// you can mock concrete classes, not only interfaces
LinkedList mockedList = mock(LinkedList.class);
// stubbing appears before the actual execution
String value = "first";
when(mockedList.get(0)).thenReturn(value);
assertEquals(mockedList.get(0), value);
}
- Please push the gradle project to your Github
- Commit your repostory link to complete this Question..