- public void Given_Request_Is_HTTP_GET_With_Api_In_Endpoint_Request_Succeeds() throws Exception {
- when(request.getPathInfo()).thenReturn("/api/Key");
- setParametersToNotContactDb(false);
+ public void Given_Request_Is_HTTP_GET_Starts_With_Logs_In_Endpoint_And_File_Exists_Then_Request_Returns_Ok()
+ throws Exception {
+ when(request.getPathInfo()).thenReturn("/logs/testFile.txt");
+ File testFile = new File("unit-test-logs/testFile.txt");
+ testFile.createNewFile();
+ testFile.deleteOnExit();
+ ServletOutputStream outStream = mock(ServletOutputStream.class);
+ when(response.getOutputStream()).thenReturn(outStream);
+ internalServlet.doGet(request, response);
+ verify(response).setStatus(eq(HttpServletResponse.SC_OK));
+ }
+
+ @Test
+ public void Given_Request_Is_HTTP_GET_With_Api_In_Endpoint_Then_Request_Succeeds() throws Exception {
+ when(request.getPathInfo()).thenReturn("/api/DELIVERY_MAX_RETRY_INTERVAL");