package pingis.controllers;

import static org.hamcrest.CoreMatchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import pingis.config.OAuthProperties;
import pingis.config.SecurityConfig;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {
    IndexController.class, SecurityConfig.class, OAuthProperties.class})

@WebAppConfiguration
@WebMvcTest(IndexController.class)
public class IndexControllerTest {

  @Autowired
  private MockMvc mvc;

  @Test
  public void simpleIndexTest() throws Exception {
    performSimpleGetReguest("/", "<h1><strong>TDD-pingpong</strong> frontpage.</h1>");
  }

  private void performSimpleGetReguest(String uri, String content) throws Exception {
    mvc.perform(get(uri))
        .andExpect(status().isOk())
        .andExpect(content().string(containsString(content)));
  }
}

@@ -26,64 +26,8 @@
 s;%0A%0A
-import static org.hamcrest.CoreMatchers.containsString;%0A
 impo
@@ -113,97 +113,8 @@
 et;%0A
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;%0A
 impo
@@ -1038,186 +1038,8 @@
 n %7B%0A
-    performSimpleGetReguest(%22/%22, %22%3Ch1%3E%3Cstrong%3ETDD-pingpong%3C/strong%3E frontpage.%3C/h1%3E%22);%0A  %7D%0A%0A  private void performSimpleGetReguest(String uri, String content) throws Exception %7B%0A
     
@@ -1054,19 +1054,19 @@
 orm(get(
-uri
+%22/%22
 ))%0A     
@@ -1099,70 +1099,8 @@
 k())
-%0A        .andExpect(content().string(containsString(content)))
 ;%0A  

Fix IndexControllerTest.