// Path: mvc/src/main/java/me/chanjar/web/FooController.java
// @Controller
// public class FooController {
// 
//   @Autowired
//   private Foo foo;
// 
//   @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET)
//   public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) {
// 
//     return new ResponseEntity<>(
//         Boolean.valueOf(foo.checkCodeDuplicate(code)),
//         HttpStatus.OK
//     );
// 
//   }
// 
// }
// 
// Path: mvc/src/main/java/me/chanjar/web/FooImpl.java
// @Component
// public class FooImpl implements Foo {
// 
//   @Override
//   public boolean checkCodeDuplicate(String code) {
//     return true;
//   }
// 
// }


import me.chanjar.web.FooController;
import me.chanjar.web.FooImpl;
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.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.web.servlet.MockMvc;
import org.testng.annotations.Test;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
package me.chanjar.springboot1;



@WebMvcTest
@ContextConfiguration(classes = { FooController.class, FooImpl.class })
public class BootMvc_1_Test extends AbstractTestNGSpringContextTests {

  @Autowired
  private MockMvc mvc;

  @Test
  public void testController() throws Exception {

// Path: mvc/src/main/java/me/chanjar/web/FooController.java
// @Controller
// public class FooController {
// 
//   @Autowired
//   private Foo foo;
// 
//   @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET)
//   public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) {
// 
//     return new ResponseEntity<>(
//         Boolean.valueOf(foo.checkCodeDuplicate(code)),
//         HttpStatus.OK
//     );
// 
//   }
// 
// }
// 
// Path: mvc/src/main/java/me/chanjar/web/FooImpl.java
// @Component
// public class FooImpl implements Foo {
// 
//   @Override
//   public boolean checkCodeDuplicate(String code) {
//     return true;
//   }
// 
// }


// Path: mvc/src/test/java/me/chanjar/springboot1/BootMvc_1_Test.java
import me.chanjar.web.FooController;
import me.chanjar.web.FooImpl;
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.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.web.servlet.MockMvc;
import org.testng.annotations.Test;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

package me.chanjar.springboot1;



@WebMvcTest
@ContextConfiguration(classes = { FooController.class, FooImpl.class })
public class BootMvc_1_Test extends AbstractTestNGSpringContextTests {

  @Autowired
  private MockMvc mvc;

  @Test
  public void testController() throws Exception {

    this.mvc.perform(get("/foo/check-code-dup").param("code", "123"))