Package controllers

Source Code of controllers.HelloPlaintextControllerTest

package controllers;

import ninja.NinjaDocTester;
import org.doctester.testbrowser.Request;
import org.doctester.testbrowser.Response;
import org.hamcrest.CoreMatchers;
import static org.hamcrest.CoreMatchers.is;
import org.junit.Test;
import static org.junit.Assert.*;

public class HelloPlaintextControllerTest extends NinjaDocTester {
   
    String URL_PLAINTEXT = "/plaintext";
   
    @Test
    public void helloPlaintextControllerTest() {
       
        Response response = makeRequest(
            Request.GET().url(testServerUrl().path(URL_PLAINTEXT)));
       
        assertThat(response.payload, CoreMatchers.is("Hello, World!"));
        assertThat(
            response.headers.get("Content-Type"),
            is("text/plain; charset=UTF-8"));
       
  
    }
   
}
TOP

Related Classes of controllers.HelloPlaintextControllerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.