Skip to content

Commit

Permalink
added unit test for missing @JsonAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
crschardt committed Dec 17, 2023
1 parent ad6cf3f commit f47543d
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.photonvision.common.util.TestUtils;
import org.photonvision.common.util.file.JacksonUtils;
import org.photonvision.vision.pipeline.AprilTagPipelineSettings;
import org.photonvision.vision.pipeline.CVPipelineSettings;
import org.photonvision.vision.pipeline.ColoredShapePipelineSettings;
import org.photonvision.vision.pipeline.ReflectivePipelineSettings;
import org.photonvision.vision.target.TargetModel;
Expand Down Expand Up @@ -141,4 +142,18 @@ public void testJacksonHandlesOldVersions() throws IOException {

new File("test.json").delete();
}

@Test
public void testJacksonHandlesOldTargetEnum() throws IOException {
var str =
"[ \"AprilTagPipelineSettings\", {\n" + " \"targetModel\" : \"k6in_16h5\"\n" + "} ]\n";
var writer = new FileWriter("test.json");
writer.write(str);
writer.flush();
writer.close();
Assertions.assertDoesNotThrow(
() -> JacksonUtils.deserialize(Path.of("test.json"), CVPipelineSettings.class));

new File("test.json").delete();
}
}

0 comments on commit f47543d

Please sign in to comment.