Skip to content

Commit b511583

Browse files
committed
modify PluginMockFactory
1 parent 17af6d7 commit b511583

File tree

1 file changed

+6
-52
lines changed

1 file changed

+6
-52
lines changed

src/test/java/org/hydev/mcpm/client/database/PluginMockFactory.java

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,6 @@ private PluginMockFactory() { }
3939
return map;
4040
}
4141

42-
/**
43-
* Creates a mock PluginYml object.
44-
*
45-
* @param name The name of the plugin.
46-
* @param version The version string for the plugin.
47-
* @param description The description for the plugin.
48-
* @return A PluginYml object.
49-
*/
50-
public static PluginYml meta(String name, String version, String description) {
51-
return new PluginYml(
52-
"org." + name,
53-
name,
54-
version,
55-
description,
56-
null,
57-
null,
58-
null,
59-
null,
60-
null,
61-
null,
62-
null,
63-
null,
64-
null,
65-
null,
66-
null
67-
);
68-
}
69-
7042
/**
7143
* Creates a mock PluginYml object.
7244
*
@@ -106,7 +78,7 @@ public static PluginYml meta(String name, String version, String description,
10678
* @return A PluginVersion object.
10779
*/
10880
public static PluginVersion version(long id, String name, String string) {
109-
return new PluginVersion(id, 0, "", meta(name, string, null));
81+
return new PluginVersion(id, 0, "", meta(name, string, null, null));
11082
}
11183

11284
/**
@@ -145,26 +117,8 @@ public static PluginModel model(long id) {
145117
*/
146118
public static PluginModel model(long id, String name) {
147119
return new PluginModel(
148-
id,
149-
List.of(version(id, name, "ver." + name)) // NOT SEMVER
150-
);
151-
}
152-
153-
/**
154-
* Creates a mock PluginModel object.
155-
* The first version in versionNames will have id 0, the next will have id 1, and so on...
156-
*
157-
* @param id The plugin id.
158-
* @param name The plugin name.
159-
* @param versionNames The individual version strings for each version.
160-
* @return A PluginModel object.
161-
*/
162-
public static PluginModel model(long id, String name, List<String> versionNames) {
163-
return new PluginModel(
164-
id,
165-
IntStream.range(0, versionNames.size())
166-
.mapToObj(i -> version(i, name, versionNames.get(i)))
167-
.toList()
120+
id,
121+
List.of(version(id, name, "ver." + name)) // NOT SEMVER
168122
);
169123
}
170124

@@ -213,9 +167,9 @@ public static DatabaseInteractor interactor(List<PluginModel> plugins) {
213167
"of land against griefers and undesirables as well " +
214168
"as tweak and disable various gameplay features of Minecraft.",
215169
"Multiverse was created at the dawn of Bukkit multiworld support. " +
216-
"It has since then grown into a complete world management " +
217-
"solution including special treatment of your nether worlds with " +
218-
"Multiverse NetherPortals.",
170+
"It has since then grown into a complete world management " +
171+
"solution including special treatment of your nether worlds with " +
172+
"Multiverse NetherPortals.",
219173
"Create futuristic holograms to display text and items to players!"
220174
};
221175

0 commit comments

Comments
 (0)