Changeset 14411 in josm for trunk/test/unit


Ignore:
Timestamp:
2018-11-04T20:51:19+01:00 (6 years ago)
Author:
wiktorn
Message:

Skip unkown tags in WMS Getcapabilities

In Layer definition, if there is any other tag than ones that are interpreted,
move to the end of the tag, as it may be complex tag and affect further parsing.

Closes: #16940

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java

    r14138 r14411  
    118118        assertEquals("bag:Matching Street", wms.getLayers().get(0).getChildren().get(0).getName());
    119119        assertEquals("Dichtstbijzijnde straat", wms.getLayers().get(0).getChildren().get(0).getTitle());
     120    }
    120121
     122    @Test
     123    public void testForTitleWithinAttribution_ticket16940() throws IOException, WMSGetCapabilitiesException {
     124        tileServer.stubFor(
     125                WireMock.get(WireMock.anyUrl())
     126                .willReturn(WireMock.aResponse().withBody(
     127                        Files.readAllBytes(Paths.get(TestUtils.getRegressionDataFile(16940, "capabilities.xml")))
     128                ))
     129        );
     130        WMSImagery wms = new WMSImagery(tileServer.url("any"));
     131        assertEquals("Hipsográfico", wms.getLayers().stream().findFirst().get().getTitle());
    121132    }
    122133}
Note: See TracChangeset for help on using the changeset viewer.