@@ -0,0 +1,3190 @@
+package com.google.sps.servlets;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.EmbeddedEntity;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.KeyFactory;%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport com.google.firebase.auth.FirebaseAuth;%0Aimport com.google.firebase.auth.FirebaseToken;%0Aimport com.google.gson.Gson;%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport org.junit.After;%0Aimport org.junit.Before;%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 GetStudentWorkspaceTest %7B%0A%0A  private final LocalServiceTestHelper helper =%0A      new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());%0A%0A  private DatastoreService datastore;%0A%0A  @Mock HttpServletRequest httpRequest;%0A%0A  @Mock HttpServletResponse httpResponse;%0A%0A  @Mock FirebaseAuth authInstance;%0A%0A  @Mock Gson gson;%0A%0A  @InjectMocks GetStudentWorkspace getWorkspace;%0A%0A  @Before%0A  public void setUp() %7B%0A    helper.setUp();%0A    datastore = DatastoreServiceFactory.getDatastoreService();%0A  %7D%0A%0A  @After%0A  public void tearDown() %7B%0A    helper.tearDown();%0A  %7D%0A%0A  @Test%0A  public void helpedBy() throws Exception %7B%0A    Entity init = new Entity(%22Class%22);%0A    ArrayList%3CString%3E setQueue = new ArrayList%3CString%3E(Arrays.asList(%22uID1%22, %22uID2%22));%0A%0A    init.setProperty(%22owner%22, %22ownerID%22);%0A    init.setProperty(%22name%22, %22testClass%22);%0A    init.setProperty(%22studentQueue%22, setQueue);%0A%0A    EmbeddedEntity queueInfo = new EmbeddedEntity();%0A    queueInfo.setProperty(%22taID%22, %22taID%22);%0A    queueInfo.setProperty(%22workspaceID%22, %22workspaceID%22);%0A%0A    EmbeddedEntity beingHelped = new EmbeddedEntity();%0A    beingHelped.setProperty(%22studentID%22, queueInfo);%0A%0A    init.setProperty(%22beingHelped%22, beingHelped);%0A%0A    datastore.put(init);%0A%0A    when(httpRequest.getParameter(%22classCode%22)).thenReturn(KeyFactory.keyToString(init.getKey()));%0A%0A    when(httpRequest.getParameter(%22studentToken%22)).thenReturn(%22testID%22);%0A    FirebaseToken mockToken = mock(FirebaseToken.class);%0A    when(authInstance.verifyIdToken(%22testID%22)).thenReturn(mockToken);%0A    when(mockToken.getUid()).thenReturn(%22studentID%22);%0A%0A    StringWriter stringWriter = new StringWriter();%0A    PrintWriter writer = new PrintWriter(stringWriter);%0A    when(httpResponse.getWriter()).thenReturn(writer);%0A%0A    when(gson.toJson(%22/workspace?workspaceID=workspaceID%22))%0A        .thenReturn(%22/workspace?workspaceID=workspaceID%22);%0A%0A    getWorkspace.doGet(httpRequest, httpResponse);%0A%0A    assertEquals(%22/workspace?workspaceID=workspaceID%22, stringWriter.toString());%0A  %7D%0A%7D%0A

Create unit tests for GetStudentWorkspace.java