@@ -0,0 +1,2653 @@
+package edu.virginia.psyc.pi.mvc;%0A%0Aimport edu.virginia.psyc.pi.Application;%0Aimport edu.virginia.psyc.pi.persistence.ParticipantDAO;%0Aimport edu.virginia.psyc.pi.persistence.ParticipantRepository;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.test.web.servlet.MvcResult;%0Aimport org.springframework.test.web.servlet.setup.MockMvcBuilders;%0Aimport org.springframework.web.context.WebApplicationContext;%0A%0Aimport java.util.Arrays;%0A%0Aimport static org.mockito.Mockito.*;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;%0A%0A/**%0A * Created with IntelliJ IDEA.%0A * User: dan%0A * Date: 3/24/14%0A * Time: 10:31 AM%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = Application.class)%0A@WebAppConfiguration%0Apublic class AdminControllerTest %7B%0A%0A%0A    @Autowired%0A    private AdminController adminController;%0A%0A    private MockMvc mockMvc;%0A%0A    @Autowired%0A    WebApplicationContext wac;%0A%0A    @Mock%0A    private ParticipantRepository participantRepository;%0A%0A%0A%0A    @Before%0A    public void setup() %7B%0A%0A        // Process mock annotations%0A        MockitoAnnotations.initMocks(this);%0A%0A        // Setup Spring test in webapp-mode (same config as spring-boot)%0A        this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();%0A    %7D%0A%0A    @Test%0A    public void testAdminListUsers() throws Exception %7B%0A%0A        ParticipantDAO p1 = new ParticipantDAO(1, %22Dan Funk%22, %22daniel.h.funk@gmail.com%22, %22bla%22, false);%0A        ParticipantDAO p2 = new ParticipantDAO(1, %22John Smith%22, %22john.h.funk@gmail.com%22, %22bla2%22, false);%0A        ParticipantDAO p3 = new ParticipantDAO(1, %22Frank Jones%22, %22frank.h.funk@gmail.com%22, %22bla3%22, false);%0A%0A        when(participantRepository.findAll()).thenReturn(Arrays.asList(p1,p2,p3));%0A%0A        MvcResult result = mockMvc.perform(get(%22/admin%22))%0A                                .andExpect((status().isOk()))%0A                                .andReturn();%0A%0A        String content = result.getResponse().getContentAsString();%0A%0A        assert(content.contains(%22daniel.h.funk@gmail.com%22));%0A%0A    %7D%0A%0A%0A%0A%7D

Format to add a simple test