1414import java .nio .file .Paths ;
1515import java .util .Collections ;
1616import me .itzg .helpers .files .Manifests ;
17+ import me .itzg .helpers .http .SharedFetch .Options ;
1718import org .junit .jupiter .api .Test ;
1819import org .junit .jupiter .api .condition .EnabledIfSystemProperty ;
1920import org .junit .jupiter .api .io .TempDir ;
@@ -58,7 +59,7 @@ void testInstallUsingVersions_onlyGameVersion(WireMockRuntimeInfo wmRuntimeInfo)
5859 .setResultsFile (resultsFile );
5960 installer .setFabricMetaBaseUrl (wmRuntimeInfo .getHttpBaseUrl ());
6061
61- installer .installUsingVersions ("1.19.3" , null , null );
62+ installer .installUsingVersions (buildSharedFetchOptions (), "1.19.3" , null , null );
6263
6364 final Path expectedLauncherPath = tempDir .resolve ("fabric-server-mc.1.19.3-loader.0.14.12-launcher.0.11.1.jar" );
6465 assertThat (expectedLauncherPath )
@@ -84,6 +85,10 @@ void testInstallUsingVersions_onlyGameVersion(WireMockRuntimeInfo wmRuntimeInfo)
8485 .at ("/files" ).isArrayContaining ("fabric-server-mc.1.19.3-loader.0.14.12-launcher.0.11.1.jar" );
8586 }
8687
88+ private Options buildSharedFetchOptions () {
89+ return Options .builder ().build ();
90+ }
91+
8792 @ Test
8893 void testWithProvidedUri (WireMockRuntimeInfo wmRuntimeInfo ) throws IOException {
8994 stubFor (
@@ -104,7 +109,7 @@ void testWithProvidedUri(WireMockRuntimeInfo wmRuntimeInfo) throws IOException {
104109 .setResultsFile (expectedResultsPath );
105110 final URI loaderUri = URI .create (wmRuntimeInfo .getHttpBaseUrl () + "/fabric-launcher.jar" );
106111
107- installer .installUsingUri (loaderUri );
112+ installer .installUsingUri (Options . builder (). build (), loaderUri );
108113
109114 final Path expectedLauncherPath = tempDir .resolve ("fabric-launcher.jar" );
110115 assertThat (expectedLauncherPath )
@@ -139,7 +144,7 @@ void testWithProvidedUri_contentDisposition(WireMockRuntimeInfo wmRuntimeInfo) t
139144
140145 final FabricLauncherInstaller installer = new FabricLauncherInstaller (tempDir );
141146 installer .installUsingUri (
142- URI .create (wmRuntimeInfo .getHttpBaseUrl () + "/server" )
147+ Options . builder (). build (), URI .create (wmRuntimeInfo .getHttpBaseUrl () + "/server" )
143148 );
144149
145150 final Path expectedLauncherPath = tempDir .resolve ("fabric-server-mc.1.19.3-loader.0.14.12-launcher.0.11.1.jar" );
@@ -178,7 +183,7 @@ void testUpgradeFromVersionToVersion(WireMockRuntimeInfo wmRuntimeInfo) {
178183 installer .setFabricMetaBaseUrl (wmRuntimeInfo .getHttpBaseUrl ());
179184
180185 installer .installUsingVersions (
181- "1.19.2" , null , null
186+ buildSharedFetchOptions (), "1.19.2" , null , null
182187 );
183188
184189 final Path expectedLauncher192 = tempDir .resolve ("fabric-server-mc.1.19.2-loader.0.14.12-launcher.0.11.1.jar" );
@@ -189,7 +194,7 @@ void testUpgradeFromVersionToVersion(WireMockRuntimeInfo wmRuntimeInfo) {
189194 // Now upgrade from 1.19.2 to 1.19.3
190195
191196 installer .installUsingVersions (
192- "1.19.3" , null , null
197+ buildSharedFetchOptions (), "1.19.3" , null , null
193198 );
194199
195200 final Path expectedLauncher193 = tempDir .resolve ("fabric-server-mc.1.19.3-loader.0.14.12-launcher.0.11.1.jar" );
@@ -212,7 +217,7 @@ void testNoNetworkUsageWhenVersionMatches(WireMockRuntimeInfo wmRuntimeInfo) {
212217 installer .setFabricMetaBaseUrl (wmRuntimeInfo .getHttpBaseUrl ());
213218
214219 installer .installUsingVersions (
215- "1.19.2" , null , null
220+ buildSharedFetchOptions (), "1.19.2" , null , null
216221 );
217222
218223 wm .verifyThat (
@@ -234,7 +239,7 @@ void testNoNetworkUsageWhenVersionMatches(WireMockRuntimeInfo wmRuntimeInfo) {
234239 wm .resetRequests ();
235240
236241 installer .installUsingVersions (
237- "1.19.2" , "0.14.12" , "0.11.1"
242+ buildSharedFetchOptions (), "1.19.2" , "0.14.12" , "0.11.1"
238243 );
239244
240245 assertThat (expectedLauncher192 )
@@ -253,6 +258,6 @@ void forRecordingVersionDiscovery() {
253258 .setResultsFile (resultsFile );
254259 installer .setFabricMetaBaseUrl ("http://localhost:8080" );
255260
256- installer .installUsingVersions ("1.19.3" , null , null );
261+ installer .installUsingVersions (buildSharedFetchOptions (), "1.19.3" , null , null );
257262 }
258263}
0 commit comments