@@ -0,0 +1,1522 @@
+package com.google.sps.servlets;%0A%0Aimport static org.mockito.ArgumentMatchers.eq;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport com.google.sps.workspace.Workspace;%0Aimport com.google.sps.workspace.WorkspaceArchive;%0Aimport com.google.sps.workspace.WorkspaceFactory;%0Aimport javax.servlet.ServletOutputStream;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class DownloadWorkspaceTest %7B%0A  @Mock WorkspaceFactory workspaceFactory;%0A  @Mock HttpServletRequest req;%0A  @Mock HttpServletResponse resp;%0A  @Mock Workspace workspace;%0A  @Mock WorkspaceArchive archive;%0A  @Mock ServletOutputStream out;%0A%0A  @InjectMocks DownloadWorkspace servlet;%0A%0A  @Test%0A  public void doGet() throws Exception %7B%0A    final String WORKSPACE_ID = %22WORKSPACE_ID%22;%0A    when(req.getParameter(eq(%22workspaceID%22))).thenReturn(WORKSPACE_ID);%0A    when(workspaceFactory.fromWorkspaceID(WORKSPACE_ID)).thenReturn(workspace);%0A    when(workspace.getArchive()).thenReturn(archive);%0A    when(resp.getOutputStream()).thenReturn(out);%0A%0A    servlet.doGet(req, resp);%0A%0A    verify(req, times(1)).getParameter(eq(%22workspaceID%22));%0A    verify(resp, times(1)).setContentType(%22application/x-gzip%22);%0A    verify(archive, times(1)).archive(out);%0A  %7D%0A%7D%0A

Add DownloadWorkspaceTest