Skip to content

Commit baca7bd

Browse files
committed
Fix WMTSLayerTest
1 parent 54cd823 commit baca7bd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/src/test/java/org/mapfish/print/map/tiled/wmts/WMTSLayerTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,16 @@ public void testComputeExtraScalingFactorPseudoMercatorGeodetic() throws Excepti
103103
CRS.decode("EPSG:3857"), centerX, centerY, 10000.0, true // useGeodeticCalculations
104104
);
105105

106+
Rectangle paintArea = new Rectangle(0, 0, 256, 256);
107+
WMTSLayer.WMTSTileInfo tileInformation =
108+
(WMTSLayer.WMTSTileInfo) wmtsLayer.createTileInformation(bounds, paintArea, 256);
109+
106110
// Access computeExtraScalingFactor via reflection (since it's private)
107111
java.lang.reflect.Method method =
108-
WMTSLayer.class.getDeclaredMethod("computeExtraScalingFactor", MapBounds.class);
112+
WMTSLayer.class.getDeclaredClasses()[0].getDeclaredMethod(
113+
"computeExtraScalingFactor", MapBounds.class);
109114
method.setAccessible(true);
110-
double scalingFactor = (double) method.invoke(wmtsLayer, bounds);
115+
double scalingFactor = (double) method.invoke(tileInformation, bounds);
111116

112117
// The scaling factor should not be 1 at non-equatorial latitude
113118
assertTrue(

0 commit comments

Comments
 (0)