@Test
public void testCrs84wms13() throws Exception {

    // prepare the responses
    MockHttpClient client = new MockHttpClient() {
        public HTTPResponse get(URL url) throws IOException {
            if (url.getQuery().contains("GetCapabilities")) {
                URL caps130 = WMSCoverageReaderTest.class.getResource("caps130_crs84.xml");
                return new MockHttpResponse(caps130, "text/xml");
            } else if (url.getQuery().contains("GetMap") && url.getQuery().contains("world84")) {
                Map<String, String> params = parseParams(url.getQuery());
                assertEquals("1.3.0", params.get("VERSION"));
                assertEquals("CRS:84", params.get("CRS"));
                assertEquals("-180.0,-90.0,180.0,90.0", params.get("BBOX"));
                URL world = WMSCoverageReaderTest.class.getResource("world.png");
                return new MockHttpResponse(world, "image/png");
            } else {
                throw new IllegalArgumentException(
                        "Don't know how to handle a get request over " + url.toExternalForm());
            }
        }
    };
    WebMapServer server = new WebMapServer(new URL("http://geoserver.org/geoserver/wms"),
            client);
    WMSCoverageReader reader = new WMSCoverageReader(server, getLayer(server, "world84"));
    // setup the request and check it
    CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326", true);
    ReferencedEnvelope worldEnvelope = new ReferencedEnvelope(-180, 180, -90, 90, wgs84);
    GridGeometry2D gg = new GridGeometry2D(new GridEnvelope2D(0, 0, 180, 90), worldEnvelope);
    final Parameter<GridGeometry2D> ggParam = (Parameter<GridGeometry2D>) AbstractGridFormat.READ_GRIDGEOMETRY2D
            .createValue();
    ggParam.setValue(gg);
    GridCoverage2D coverage = reader.read(new GeneralParameterValue[] { ggParam });
    assertTrue(CRS.equalsIgnoreMetadata(wgs84, coverage.getCoordinateReferenceSystem()));
    assertEquals(worldEnvelope, new ReferencedEnvelope(coverage.getEnvelope()));
}