play.mvc.Result.contentType()

Here are the examples of the java api play.mvc.Result.contentType() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

16 Source : ApplicantProgramsControllerTest.java
with Apache License 2.0
from seattle-uat

@Test
public void index_withNoPrograms_returnsEmptyResult() {
    Result result = controller.index(fakeRequest().build(), 1L).toCompletableFuture().join();
    replacedertThat(result.status()).isEqualTo(OK);
    replacedertThat(result.contentType()).hasValue("text/html");
    replacedertThat(result.charset()).hasValue("utf-8");
    replacedertThat(contentreplacedtring(result)).contains("Programs");
}

16 Source : AdminProgramControllerTest.java
with Apache License 2.0
from seattle-uat

@Test
public void index_withNoPrograms() {
    Result result = controller.index();
    replacedertThat(result.status()).isEqualTo(OK);
    replacedertThat(result.contentType()).hasValue("text/html");
    replacedertThat(result.charset()).hasValue("utf-8");
    replacedertThat(contentreplacedtring(result)).contains("Programs");
}

15 Source : FilterTest.java
with MIT License
from project-sunbird

@Test
public void testApiResponseWithGzipDisabledSuccessForGzippedResponse() {
    mockSystemSetting(false);
    RequestBuilder req = new RequestBuilder().uri("/v1/user/type/list").method("GET");
    // req.headers(headerMap);
    Result result = Helpers.route(application, req);
    replacedertEquals("application/json", result.contentType());
}

15 Source : FilterTest.java
with MIT License
from project-sunbird

@Test
public void testApiResponseFailureGzipEnabledAndRequestedGzipResponse() {
    mockSystemSetting(true);
    RequestBuilder req = new RequestBuilder().uri("/v1/user/type/list").method("GET");
    // req.headers(headerMap);
    Result result = Helpers.route(application, req);
    replacedertEquals("application/json", result.contentType());
}

15 Source : FilterTest.java
with MIT License
from project-sunbird

@Test
public void testApiResponseWithGzipDisabledSuccess() {
    mockSystemSetting(false);
    // headerMap.put("Accept-Encoding", new String[] {"gzip"});
    RequestBuilder req = new RequestBuilder().uri("/v1/user/type/list").method("GET");
    // req.headers(headerMap);
    Result result = Helpers.route(application, req);
    replacedertEquals("application/json", result.contentType());
}