mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Reconcile wave 1 test fixtures: one serveModules helper, stub the pack folder after it
This commit is contained in:
1 parent
25fd24b7c2
commit
4de4b346aa
3 files changed
+27
-10
No files matched your search
@@ -77,15 +77,6 @@ public final class ModuleResourceFixture {
|
||||
return registry.freeze();
|
||||
}
|
||||
|
||||
/** Makes {@code data} (a mock) load {@code modules} as its pack's modules, so services and hooks of theirs answer. */
|
||||
public static void serveModules(IrisData data, IrisModule... modules) {
|
||||
LoadedPack pack = mock(LoadedPack.class);
|
||||
when(pack.catalog()).thenReturn(catalogOf(modules));
|
||||
PackModuleSet moduleSet = mock(PackModuleSet.class);
|
||||
when(moduleSet.pack()).thenReturn(pack);
|
||||
when(data.getModules()).thenReturn(moduleSet);
|
||||
}
|
||||
|
||||
/** Serves {@code resource} as the resource of {@code kind} the pack names by {@code key}. */
|
||||
public <T> ModuleResourceFixture resource(ResourceKind<T> kind, String key, T resource) {
|
||||
ResourceId id = idOf(key);
|
||||
|
||||
@@ -105,8 +105,8 @@ public class StructureIndexServiceTest {
|
||||
IrisData data = mock(IrisData.class);
|
||||
IrisPlatform platform = mock(IrisPlatform.class);
|
||||
PlatformStructureHooks structureHooks = mock(PlatformStructureHooks.class);
|
||||
when(data.getDataFolder()).thenReturn(pack);
|
||||
ModuleResourceFixture.serveModules(data, new StructureModule());
|
||||
when(data.getDataFolder()).thenReturn(pack);
|
||||
ModuleResourceFixture.serve(data)
|
||||
.resource(StructureResources.STRUCTURES, "castle", new IrisStructure())
|
||||
.resource(StructureResources.STRUCTURES, "structure-index", new IrisStructure());
|
||||
|
||||
Reference in new issue
Block a user