-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d37395f
commit a9a27db
Showing
4 changed files
with
52 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/test/java/com/osiris/autoplug/client/tasks/updater/DoCustomUpdateCheckTest.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
src/test/java/com/osiris/autoplug/client/tasks/updater/TestPluginUpdaters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2024 Osiris-Team. | ||
* All rights reserved. | ||
* | ||
* This software is copyrighted work, licensed under the terms | ||
* of the MIT-License. Consult the "LICENSE" file for details. | ||
*/ | ||
|
||
package com.osiris.autoplug.client.tasks.updater; | ||
|
||
import com.osiris.autoplug.client.UtilsTest; | ||
import com.osiris.autoplug.client.tasks.updater.mods.ModrinthAPI; | ||
import com.osiris.autoplug.client.tasks.updater.plugins.MinecraftPlugin; | ||
import com.osiris.autoplug.client.tasks.updater.search.CustomCheckURL; | ||
import com.osiris.autoplug.client.tasks.updater.search.SearchResult; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertSame; | ||
|
||
|
||
class TestPluginUpdaters { | ||
@Test | ||
void testCustom() throws IOException { | ||
UtilsTest.init(); | ||
MinecraftPlugin pl = new MinecraftPlugin("./plugins/", "Chunky", "0.0.0", "pop4959", 0, 0, null); | ||
pl.customCheckURL = "https://api.modrinth.com/v2/project/chunky/version"; | ||
pl.customDownloadURL = "https://cdn.modrinth.com/data/fALzjamp/versions/dPliWter/Chunky-1.4.16.jar"; | ||
SearchResult sr = new CustomCheckURL().doCustomCheck(pl.customCheckURL, pl.getVersion()); | ||
assertSame(SearchResult.Type.UPDATE_AVAILABLE, sr.type); | ||
} | ||
|
||
@Test | ||
void testModrinth() throws IOException { | ||
UtilsTest.init(); | ||
MinecraftPlugin pl = new MinecraftPlugin("./plugins/", "BMMarker", "0.0.0", "Miraculixx", 0, 0, null); | ||
pl.modrinthId = "a8UoyV2h"; | ||
SearchResult sr = new ModrinthAPI().searchUpdatePlugin(pl, "1.21.1"); | ||
assertSame(SearchResult.Type.UPDATE_AVAILABLE, sr.type); | ||
} | ||
} |