package io.github.jordao76.quotes;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

import org.junit.*;
import org.junit.runner.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.boot.test.*;
import org.springframework.test.context.junit4.*;
import org.springframework.test.context.web.*;
import org.springframework.test.web.servlet.*;
import org.springframework.test.web.servlet.setup.*;
import org.springframework.web.context.*;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = QuoteApplication.class)
@WebAppConfiguration
public class QuoteControllerTest {

  @Autowired
  private WebApplicationContext wac;

  private MockMvc client;

  @Before
  public void setup() {
    client = MockMvcBuilders.webAppContextSetup(wac).build();
  }

  @Test
  public void getQuotes() throws Exception {
    client
      .perform(get("/quotes"))
      .andExpect(status().isOk())
      .andExpect(content().contentType("application/json;charset=UTF-8"));
  }

}

@@ -29,16 +29,55 @@
 uotes;%0A%0A
+import static org.hamcrest.Matchers.*;%0A
 import s
@@ -1163,16 +1163,140 @@
 UTF-8%22))
+%0A      .andExpect(content().string(containsString(%22Any sufficiently advanced technology is indistinguishable from magic.%22)))
 ;%0A  %7D%0A%0A%7D

Check for some JSON content in the test