File tree Expand file tree Collapse file tree 3 files changed +2
-29
lines changed
src/test/java/com/example/appengine/requests Expand file tree Collapse file tree 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.
9393 <!-- for hot reload of the web application -->
9494 <outputDirectory >${project.build.directory} /${project.build.finalName} /WEB-INF/classes</outputDirectory >
9595 <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+
10597 <plugin >
10698 <groupId >com.google.appengine</groupId >
10799 <artifactId >appengine-maven-plugin</artifactId >
Original file line number Diff line number Diff line change 1919import static com .google .common .truth .Truth .assertThat ;
2020import static org .mockito .Mockito .when ;
2121
22- import com .google .appengine .tools .development .testing .LocalServiceTestHelper ;
23-
2422import org .junit .After ;
2523import org .junit .Before ;
2624import org .junit .Test ;
4240 */
4341@ RunWith (JUnit4 .class )
4442public 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-
4843 // To capture and restore stderr
4944 private final ByteArrayOutputStream stderr = new ByteArrayOutputStream ();
5045 private static final PrintStream REAL_ERR = System .err ;
@@ -60,7 +55,6 @@ public void setUp() throws Exception {
6055 System .setErr (new PrintStream (stderr ));
6156
6257 MockitoAnnotations .initMocks (this );
63- helper .setUp ();
6458
6559 // Set up a fake HTTP response.
6660 responseWriter = new StringWriter ();
@@ -73,8 +67,6 @@ public void setUp() throws Exception {
7367 public void tearDown () {
7468 // Restore stderr
7569 System .setErr (LoggingServletTest .REAL_ERR );
76-
77- helper .tearDown ();
7870 }
7971
8072 @ Test
Original file line number Diff line number Diff line change 1919import static com .google .common .truth .Truth .assertThat ;
2020import static org .mockito .Mockito .when ;
2121
22- import com .google .appengine .tools .development .testing .LocalServiceTestHelper ;
23-
24- import org .junit .After ;
2522import org .junit .Before ;
2623import org .junit .Test ;
2724import org .junit .runner .RunWith ;
4037 */
4138@ RunWith (JUnit4 .class )
4239public 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-
4640 @ Mock private HttpServletRequest mockRequest ;
4741 @ Mock private HttpServletResponse mockResponse ;
4842 private StringWriter responseWriter ;
@@ -51,19 +45,14 @@ public class RequestsServletTest {
5145 @ Before
5246 public void setUp () throws Exception {
5347 MockitoAnnotations .initMocks (this );
54- helper .setUp ();
5548
5649 // Set up a fake HTTP response.
5750 responseWriter = new StringWriter ();
5851 when (mockResponse .getWriter ()).thenReturn (new PrintWriter (responseWriter ));
5952
6053 servletUnderTest = new RequestsServlet ();
6154 }
62-
63- @ After public void tearDown () {
64- helper .tearDown ();
65- }
66-
55+
6756 @ Test
6857 public void doGet_writesResponse () throws Exception {
6958 servletUnderTest .doGet (mockRequest , mockResponse );
You can’t perform that action at this time.
0 commit comments