// Path: src/main/java/com/google/sps/servlets/ServeServlet.java
// @WebServlet("/serve")
// public class ServeServlet extends HttpServlet {
// 
//   @Override
//   public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
//     BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
//     serveImage(request, response, blobstoreService);
//   }
// 
//   // Adds helper function to provide visibility for testing.
//   public void serveImage(HttpServletRequest request, HttpServletResponse response, BlobstoreService blobstoreService) throws IOException {
//     if (request.getParameter("blobKey") != null) {
//       BlobKey blobKey = new BlobKey(request.getParameter("blobKey"));
//       blobstoreService.serve(blobKey, response);
//     }
//   }
// }


import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreFailureException;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.sps.servlets.ServeServlet;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.Test;
import org.mockito.Mock;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package com.google.sps;


@RunWith(value = BlockJUnit4ClassRunner.class)
public final class ServeServletTest {
// Path: src/main/java/com/google/sps/servlets/ServeServlet.java
// @WebServlet("/serve")
// public class ServeServlet extends HttpServlet {
// 
//   @Override
//   public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
//     BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
//     serveImage(request, response, blobstoreService);
//   }
// 
//   // Adds helper function to provide visibility for testing.
//   public void serveImage(HttpServletRequest request, HttpServletResponse response, BlobstoreService blobstoreService) throws IOException {
//     if (request.getParameter("blobKey") != null) {
//       BlobKey blobKey = new BlobKey(request.getParameter("blobKey"));
//       blobstoreService.serve(blobKey, response);
//     }
//   }
// }


// Path: src/test/java/com/google/sps/servlets/ServeServletTest.java
import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreFailureException;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.sps.servlets.ServeServlet;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.Test;
import org.mockito.Mock;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package com.google.sps;


@RunWith(value = BlockJUnit4ClassRunner.class)
public final class ServeServletTest {
  ServeServlet serveServlet = new ServeServlet();