From 0d70d9f201bf0f9f912151a77595a74b7e91ce46 Mon Sep 17 00:00:00 2001 From: Kimmo Tuukkanen Date: Sat, 11 Feb 2023 15:12:09 +0200 Subject: [PATCH] Add parser test for #138 --- .../marineapi/ais/parser/AISMessageFactoryTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/net/sf/marineapi/ais/parser/AISMessageFactoryTest.java b/src/test/java/net/sf/marineapi/ais/parser/AISMessageFactoryTest.java index e6fc942d..3e52e0e2 100644 --- a/src/test/java/net/sf/marineapi/ais/parser/AISMessageFactoryTest.java +++ b/src/test/java/net/sf/marineapi/ais/parser/AISMessageFactoryTest.java @@ -32,6 +32,16 @@ public void testCreate() { assertEquals(1, msg.getMessageType()); } + @Test + public void testCreateIssue138() { + String ais = "!AIVDM,1,1,,A,15S0t`001TlGn>TNurwroHgD05;H,0*21"; + AISSentence s = (AISSentence) sf.createParser(ais); + AISMessage msg = amf.create(s); + assertTrue(msg instanceof AISMessage01); + assertEquals(1, msg.getMessageType()); + assertTrue((((AISMessage01) msg).isAccurate())); + } + @Test public void testCreateWithTwo() { AISMessage msg = amf.create(split1, split2); @@ -51,4 +61,6 @@ public void testCreateWithIncorrectOrder() { } } + + }