File tree 3 files changed +2
-29
lines changed
src/test/java/com/example/appengine/requests
3 files changed +2
-29
lines changed Original file line number Diff line number Diff line change @@ -93,15 +93,7 @@ Copyright 2016 Google Inc. All Rights Reserved.
93
93
<!-- for hot reload of the web application -->
94
94
<outputDirectory >${project.build.directory} /${project.build.finalName} /WEB-INF/classes</outputDirectory >
95
95
<plugins >
96
- <plugin >
97
- <groupId >org.apache.maven.plugins</groupId >
98
- <version >3.3</version >
99
- <artifactId >maven-compiler-plugin</artifactId >
100
- <configuration >
101
- <source >1.7</source >
102
- <target >1.7</target >
103
- </configuration >
104
- </plugin >
96
+
105
97
<plugin >
106
98
<groupId >com.google.appengine</groupId >
107
99
<artifactId >appengine-maven-plugin</artifactId >
Original file line number Diff line number Diff line change 19
19
import static com .google .common .truth .Truth .assertThat ;
20
20
import static org .mockito .Mockito .when ;
21
21
22
- import com .google .appengine .tools .development .testing .LocalServiceTestHelper ;
23
-
24
22
import org .junit .After ;
25
23
import org .junit .Before ;
26
24
import org .junit .Test ;
42
40
*/
43
41
@ RunWith (JUnit4 .class )
44
42
public class LoggingServletTest {
45
- // Set up a helper so that the ApiProxy returns a valid environment for local testing.
46
- private final LocalServiceTestHelper helper = new LocalServiceTestHelper ();
47
-
48
43
// To capture and restore stderr
49
44
private final ByteArrayOutputStream stderr = new ByteArrayOutputStream ();
50
45
private static final PrintStream REAL_ERR = System .err ;
@@ -60,7 +55,6 @@ public void setUp() throws Exception {
60
55
System .setErr (new PrintStream (stderr ));
61
56
62
57
MockitoAnnotations .initMocks (this );
63
- helper .setUp ();
64
58
65
59
// Set up a fake HTTP response.
66
60
responseWriter = new StringWriter ();
@@ -73,8 +67,6 @@ public void setUp() throws Exception {
73
67
public void tearDown () {
74
68
// Restore stderr
75
69
System .setErr (LoggingServletTest .REAL_ERR );
76
-
77
- helper .tearDown ();
78
70
}
79
71
80
72
@ Test
Original file line number Diff line number Diff line change 19
19
import static com .google .common .truth .Truth .assertThat ;
20
20
import static org .mockito .Mockito .when ;
21
21
22
- import com .google .appengine .tools .development .testing .LocalServiceTestHelper ;
23
-
24
- import org .junit .After ;
25
22
import org .junit .Before ;
26
23
import org .junit .Test ;
27
24
import org .junit .runner .RunWith ;
40
37
*/
41
38
@ RunWith (JUnit4 .class )
42
39
public class RequestsServletTest {
43
- // Set up a helper so that the ApiProxy returns a valid environment for local testing.
44
- private final LocalServiceTestHelper helper = new LocalServiceTestHelper ();
45
-
46
40
@ Mock private HttpServletRequest mockRequest ;
47
41
@ Mock private HttpServletResponse mockResponse ;
48
42
private StringWriter responseWriter ;
@@ -51,19 +45,14 @@ public class RequestsServletTest {
51
45
@ Before
52
46
public void setUp () throws Exception {
53
47
MockitoAnnotations .initMocks (this );
54
- helper .setUp ();
55
48
56
49
// Set up a fake HTTP response.
57
50
responseWriter = new StringWriter ();
58
51
when (mockResponse .getWriter ()).thenReturn (new PrintWriter (responseWriter ));
59
52
60
53
servletUnderTest = new RequestsServlet ();
61
54
}
62
-
63
- @ After public void tearDown () {
64
- helper .tearDown ();
65
- }
66
-
55
+
67
56
@ Test
68
57
public void doGet_writesResponse () throws Exception {
69
58
servletUnderTest .doGet (mockRequest , mockResponse );
You can’t perform that action at this time.
0 commit comments