1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.codehaus.gmavenplus.mojo;
18
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.mockito.Mock;
22 import org.mockito.MockitoAnnotations;
23
24 import java.io.File;
25
26 import static org.junit.Assert.assertEquals;
27 import static org.mockito.Mockito.doReturn;
28
29
30
31
32
33
34
35 public class AbstractGroovyStubSourcesMojoTest {
36 private TestMojo testMojo;
37 @Mock
38 private File outputDirectory;
39 private static final String PATH = "path";
40
41 @Before
42 public void setup() {
43 MockitoAnnotations.openMocks(this);
44 testMojo = new TestMojo();
45 doReturn(PATH).when(outputDirectory).getAbsolutePath();
46 }
47
48 @Test
49 public void testGetStubsEmpty() {
50 assertEquals(0, testMojo.getStubs(outputDirectory).size());
51 }
52
53 protected static class TestMojo extends AbstractGroovyStubSourcesMojo {
54 @Override
55 public void execute() {
56 }
57 }
58
59 }