← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10033: FRED-API: verify content-type in tests

 

------------------------------------------------------------
revno: 10033
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-07 12:31:13 +0300
message:
  FRED-API: verify content-type in tests
modified:
  dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java	2013-03-07 09:28:11 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java	2013-03-07 09:31:13 +0000
@@ -61,6 +61,7 @@
         MockHttpSession session = getSession( "ALL" );
 
         mvc.perform( get( "/v1/facilities" ).session( session ).accept( MediaType.APPLICATION_JSON ) )
+            .andExpect( content().contentType( MediaType.APPLICATION_JSON ) )
             .andExpect( jsonPath( "$.facilities" ).isArray() )
             .andExpect( status().isOk() );
     }
@@ -71,6 +72,7 @@
         MockHttpSession session = getSession( "M_dhis-web-api-fred" );
 
         mvc.perform( get( "/v1/facilities" ).session( session ).accept( MediaType.APPLICATION_JSON ) )
+            .andExpect( content().contentType( MediaType.APPLICATION_JSON ) )
             .andExpect( jsonPath( "$.facilities" ).isArray() )
             .andExpect( status().isOk() );
     }
@@ -93,6 +95,7 @@
         MockHttpSession session = getSession( "ALL" );
 
         mvc.perform( get( "/v1/facilities" ).session( session ).accept( MediaType.APPLICATION_JSON ) )
+            .andExpect( content().contentType( MediaType.APPLICATION_JSON ) )
             .andExpect( jsonPath( "$.facilities" ).isArray() )
             .andExpect( jsonPath( "$.facilities[0].name" ).value( "OrgUnitA" ) )
             .andExpect( status().isOk() );
@@ -116,6 +119,7 @@
         MockHttpSession session = getSession( "ALL" );
 
         mvc.perform( get( "/v1/facilities/" + organisationUnit.getUid() ).session( session ).accept( MediaType.APPLICATION_JSON ) )
+            .andExpect( content().contentType( MediaType.APPLICATION_JSON ) )
             .andExpect( jsonPath( "$.name" ).value( "OrgUnitA" ) )
             .andExpect( status().isOk() );
     }
@@ -129,6 +133,7 @@
         MockHttpSession session = getSession( "ALL" );
 
         mvc.perform( get( "/v1/facilities/" + organisationUnit.getUuid() ).session( session ).accept( MediaType.APPLICATION_JSON ) )
+            .andExpect( content().contentType( MediaType.APPLICATION_JSON ) )
             .andExpect( jsonPath( "$.name" ).value( "OrgUnitA" ) )
             .andExpect( status().isOk() );
     }