Ignore:
Timestamp:
2018-05-29T22:36:33+02:00 (7 years ago)
Author:
wiktorn
Message:

Fix NPE when style title is null

Closes: #16333

File:
1 edited

Legend:

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

    r13742 r13870  
    9797                wms.buildGetMapUrl(wms.getLayers(), (List<String>) null, true));
    9898    }
     99
     100    /**
     101     * Regression test for bug #16333 (null style name)
     102     * @throws IOException if any I/O error occurs
     103     * @throws WMSGetCapabilitiesException  never
     104     */
     105    @Test
     106    public void testTicket16333() throws IOException, WMSGetCapabilitiesException {
     107        tileServer.stubFor(
     108                WireMock.get(WireMock.anyUrl())
     109                .willReturn(WireMock.aResponse().withBody(
     110                        Files.readAllBytes(Paths.get(TestUtils.getRegressionDataFile(16333, "capabilities.xml")))
     111                ))
     112        );
     113        WMSImagery wms = new WMSImagery(tileServer.url("any"));
     114        assertEquals("https://duinoord.xs4all.nl/geoserver/ows?SERVICE=WMS&", wms.buildRootUrl());
     115        assertEquals(null, wms.getLayers().get(0).getName());
     116        assertEquals("", wms.getLayers().get(0).getTitle());
     117
     118        assertEquals("bag:Matching Street", wms.getLayers().get(0).getChildren().get(0).getName());
     119        assertEquals("Dichtstbijzijnde straat", wms.getLayers().get(0).getChildren().get(0).getTitle());
     120
     121    }
    99122}
    100123
Note: See TracChangeset for help on using the changeset viewer.