@@ -0,0 +1,1941 @@
+package com.google.step.coffee.servlets;%0A%0Aimport com.google.appengine.api.datastore.*;%0Aimport com.google.step.coffee.HttpError;%0Aimport com.google.step.coffee.JsonServletRequest;%0Aimport com.google.step.coffee.TestHelper;%0Aimport com.google.step.coffee.entity.Group;%0Aimport org.junit.Test;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.CoreMatchers.*;%0A%0Apublic class GroupDeleteServletTest extends TestHelper %7B%0A  private void deleteGroup(Key key) throws Exception %7B%0A    HttpServletRequest request = mock(HttpServletRequest.class);%0A    when(request.getParameter(%22id%22)).thenReturn(KeyFactory.keyToString(key));%0A    JsonServletRequest jsonServletRequest = new JsonServletRequest(request);%0A    new GroupDeleteServlet().post(jsonServletRequest);%0A  %7D%0A  %0A  @Test%0A  public void testDelete() throws Exception %7B%0A    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();%0A%0A    Entity groupEntity1 = new Entity(%22group%22);%0A    groupEntity1.setProperty(%22name%22, %22foo%22);%0A    groupEntity1.setProperty(%22description%22, %22foo's desc%22);%0A    datastore.put(groupEntity1);%0A%0A    Entity groupEntity2 = new Entity(%22group%22);%0A    groupEntity2.setProperty(%22name%22, %22bar%22);%0A    groupEntity2.setProperty(%22description%22, %22bar's desc%22);%0A    datastore.put(groupEntity2);%0A%0A    Entity groupEntity3 = new Entity(%22group%22);%0A    groupEntity3.setProperty(%22name%22, %22baz%22);%0A    groupEntity3.setProperty(%22description%22, %22baz's desc%22);%0A    datastore.put(groupEntity3);%0A%0A    deleteGroup(groupEntity2.getKey());%0A%0A    // test that the entities are still there%0A    datastore.get(groupEntity1.getKey());%0A    datastore.get(groupEntity3.getKey());%0A%0A    // test that the deleted entity is gone%0A    try %7B%0A      datastore.get(groupEntity2.getKey());%0A      assert false;%0A    %7D catch (EntityNotFoundException ignored) %7B%7D%0A  %7D%0A%7D%0A

Add tests for GroupDeleteServlet