Skip to content

Commit 1b2416b

Browse files
committed
fix test
1 parent 241fe91 commit 1b2416b

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

enigma/src/test/java/org/quiltmc/enigma/translation/mapping/TestMethodOverrideParamJavadoc.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.quiltmc.enigma.translation.mapping;
22

33
import org.junit.jupiter.api.Assertions;
4-
import org.junit.jupiter.api.BeforeAll;
4+
import org.junit.jupiter.api.BeforeEach;
55
import org.junit.jupiter.api.Test;
66
import org.quiltmc.enigma.TestEntryFactory;
77
import org.quiltmc.enigma.TestUtil;
@@ -31,38 +31,35 @@ public class TestMethodOverrideParamJavadoc {
3131
private static Enigma enigma;
3232
private static EnigmaProject project;
3333

34-
@BeforeAll
35-
static void setupEnigma() throws IOException {
34+
@BeforeEach
35+
void setupEnigma() throws IOException {
3636
enigma = Enigma.create();
3737
project = enigma.openJar(JAR, new ClasspathClassProvider(), ProgressListener.createEmpty());
3838
}
3939

4040
void test(ReadWriteService readWriteService, String tmpNameSuffix) throws IOException, MappingParseException {
41-
var remapper = project.getRemapper();
42-
4341
ClassEntry inheritor = TestEntryFactory.newClass("a");
4442
MethodEntry method = TestEntryFactory.newMethod(inheritor, "a", "(D)D");
4543
LocalVariableEntry param = TestEntryFactory.newParameter(method, 1);
4644

47-
EntryMapping mapping = remapper.getMapping(param);
45+
EntryMapping mapping = project.getRemapper().getMapping(param);
4846
Assertions.assertNull(mapping.javadoc());
4947

50-
remapper.putMapping(TestUtil.newVC(), param, mapping.withJavadoc("gaming"));
48+
project.getRemapper().putMapping(TestUtil.newVC(), param, mapping.withJavadoc("gaming"));
5149

52-
EntryMapping withJavadoc = remapper.getMapping(param);
50+
EntryMapping withJavadoc = project.getRemapper().getMapping(param);
5351
Assertions.assertEquals("gaming", withJavadoc.javadoc());
5452

5553
File tempFile = File.createTempFile("testMethodOverrideParamJavadoc", tmpNameSuffix);
5654
tempFile.delete(); //remove the auto created file
5755

58-
readWriteService.write(remapper.getMappings(), tempFile.toPath(), ProgressListener.createEmpty(), PARAMETERS);
56+
readWriteService.write(project.getRemapper().getMappings(), tempFile.toPath(), ProgressListener.createEmpty(), PARAMETERS);
5957
Assertions.assertTrue(tempFile.exists(), "Written file not created");
6058
EntryTree<EntryMapping> loadedMappings = readWriteService.read(tempFile.toPath(), ProgressListener.createEmpty());
6159

6260
project.setMappings(loadedMappings, ProgressListener.createEmpty());
63-
remapper = project.getRemapper();
6461

65-
EntryMapping newMapping = remapper.getMapping(param);
62+
EntryMapping newMapping = project.getRemapper().getMapping(param);
6663
Assertions.assertEquals("gaming", newMapping.javadoc());
6764
}
6865

0 commit comments

Comments
 (0)