Skip to content

Commit 60f706b

Browse files
committed
Clean test
1 parent baca7bd commit 60f706b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ public void testComputeExtraScalingFactorPseudoMercatorGeodetic() throws Excepti
9393
matrix2.scaleDenominator = 279541132.014;
9494
params.matrices = new Matrix[] {matrix1, matrix2};
9595

96-
WMTSLayer wmtsLayer = new WMTSLayer(null, null, params, null, new Configuration());
97-
9896
// Center at non-equatorial latitude (e.g., Lausanne, Switzerland)
9997
double centerX = 732000.0;
10098
double centerY = 5860000.0;
@@ -103,13 +101,14 @@ public void testComputeExtraScalingFactorPseudoMercatorGeodetic() throws Excepti
103101
CRS.decode("EPSG:3857"), centerX, centerY, 10000.0, true // useGeodeticCalculations
104102
);
105103

104+
WMTSLayer wmtsLayer = new WMTSLayer(null, null, params, null, new Configuration());
106105
Rectangle paintArea = new Rectangle(0, 0, 256, 256);
107106
WMTSLayer.WMTSTileInfo tileInformation =
108107
(WMTSLayer.WMTSTileInfo) wmtsLayer.createTileInformation(bounds, paintArea, 256);
109108

110109
// Access computeExtraScalingFactor via reflection (since it's private)
111110
java.lang.reflect.Method method =
112-
WMTSLayer.class.getDeclaredClasses()[0].getDeclaredMethod(
111+
WMTSLayer.WMTSTileInfo.class.getDeclaredMethod(
113112
"computeExtraScalingFactor", MapBounds.class);
114113
method.setAccessible(true);
115114
double scalingFactor = (double) method.invoke(tileInformation, bounds);
@@ -119,8 +118,6 @@ public void testComputeExtraScalingFactorPseudoMercatorGeodetic() throws Excepti
119118
scalingFactor != 1.0, "Scaling factor should differ from 1 for non-equatorial latitude");
120119
// Should be > 1 at higher latitudes (distance per degree decreases)
121120
assertTrue(scalingFactor > 1.0, "Scaling factor should be > 1 at higher latitudes");
122-
// Should be finite and positive
123121
assertTrue(Double.isFinite(scalingFactor), "Scaling factor should be finite");
124-
assertTrue(scalingFactor > 0, "Scaling factor should be positive");
125122
}
126123
}

0 commit comments

Comments
 (0)