"level" : 30,
"notes" : 964,
"albumType" : "ALBUM C"
+ }, {
+ "attribute" : "キュート",
+ "name" : "cherry*merry*cherry",
+ "difficulty" : "DEBUT",
+ "level" : 8,
+ "notes" : 126,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "cherry*merry*cherry",
+ "difficulty" : "REGULAR",
+ "level" : 12,
+ "notes" : 178,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "cherry*merry*cherry",
+ "difficulty" : "PRO",
+ "level" : 17,
+ "notes" : 344,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "cherry*merry*cherry",
+ "difficulty" : "MASTER",
+ "level" : 25,
+ "notes" : 605,
+ "albumType" : "Not-Implemented"
} ]
}
\ No newline at end of file
--- /dev/null
+package test;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ranfa.lib.CheckVersion;
+
+public class VersionTest {
+
+ @Test
+ public void matchJSONandAnnotations() {
+ String annotationVersion = CheckVersion.getVersion();
+ int major, minor, patch;
+ major = minor = patch = 0;
+ try {
+ JsonNode node = new ObjectMapper().readTree(Paths.get("version.json").toFile());
+ major = node.get("major").asInt();
+ minor = node.get("minor").asInt();
+ patch = node.get("patch").asInt();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ String jsonVersion = String.format("v%d.%d.%d", major, minor, patch);
+ // check if json version and annotation version are equal.
+ assertTrue(jsonVersion.equals(annotationVersion));
+ }
+
+}