package ru.aserdyuchenko.servlet;

import static org.junit.Assert.*;

public class ServletDeleteUserTest {

}
@@ -39,71 +39,987 @@
 ort 
-static org.junit.Assert.*;%0A%0Apublic class ServletDeleteUserTest %7B%0A
+org.junit.Test;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0Aimport java.sql.SQLException;%0Aimport java.util.List;%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class ServletDeleteUserTest %7B%0A    @Test%0A    public void addUser() throws ServletException, IOException, SQLException %7B%0A        ServletDeleteUser servlet = new ServletDeleteUser();%0A        HttpServletRequest request = mock(HttpServletRequest.class);%0A        HttpServletResponse response = mock(HttpServletResponse.class);%0A        List%3CUser%3E users = DataSource.getInstance().getList();%0A%0A        User user = users.get(users.size() - 1);%0A%0A        when(request.getParameter(%22login%22)).thenReturn(user.getLogin());%0A%0A        servlet.doPost(request, response);%0A%0A        assertFalse(DataSource.getInstance().getList().contains(user));%0A    %7D
 %0A%7D

Test for add and delete user.