kopia lustrzana https://github.com/bertrik/ttnhabbridge
add milliseconds precision
rodzic
892b5a1fdd
commit
daaecf30b5
|
@ -32,14 +32,13 @@ public final class SentenceTest {
|
|||
*/
|
||||
@Test
|
||||
public void testSentenceJson() {
|
||||
Instant instant = Instant.ofEpochSecond(0);
|
||||
Instant instant = Instant.ofEpochMilli(1652126056001L);
|
||||
Sentence sentence = new Sentence("CALL", 1, instant);
|
||||
sentence.addField("lon", "3.45");
|
||||
sentence.addField("lat", "6.78");
|
||||
sentence.addField("alt", "9.0");
|
||||
String s = sentence.amateurSondehubFormat();
|
||||
|
||||
Assert.assertEquals("{\"lon\":\"3.45\",\"lat\":\"6.78\",\"alt\":\"9.0\"}", s);
|
||||
Assert.assertEquals("{\"lon\":\"3.45\",\"lat\":\"6.78\",\"alt\":\"9.0\",\"software_name\":\"ttnhabbridge\",\"software_version\":\"0.0.1\",\"uploader_callsign\":\"foobar\",\"time_received\":\"2022-05-09T19:54:16.001Z\",\"datetime\":\"2022-05-09T19:54:16.001Z\",\"payload_callsign\":\"CALL\"}", s);
|
||||
Assert.assertNotNull(sentence.toString());
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue