Skip to content

Commit

Permalink
Completed HL7Parser coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-pabon-tf committed Dec 17, 2024
1 parent f4290aa commit 2a157a7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ public static Map<String, Character> getEncodingCharacterMap(String encodingChar

return Map.of(
FIELD_DELIMITER_NAME, HL7Parser.DEFAULT_FIELD_DELIMITER,
COMPONENT_DELIMITER_NAME,
encodingCharacters.length > 0
? encodingCharacters[0]
: HL7Parser.DEFAULT_COMPONENT_DELIMITER,
COMPONENT_DELIMITER_NAME, HL7Parser.DEFAULT_COMPONENT_DELIMITER,
REPETITION_DELIMITER_NAME,
encodingCharacters.length > 1
? encodingCharacters[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,36 @@ OBX|1|ST|57723-9^Unique bar code number of Current sample^LN||123456||||||F|||20
then:
out == null
}

def "getEncodingCharacterMap uses default definitions when encoding characters are not available"() {
when:
def out = HL7Parser.getEncodingCharacterMap("tes")

then:
out.size() > 0
}

def "getEncodingCharacterMap uses default definitions if the encoding characters are blank"() {
when:
def out = HL7Parser.getEncodingCharacterMap(" ")

then:
out.size() > 0
}

def "getEncodingCharacterMap uses default definitions if the encoding characters are whitespace"() {
when:
def out = HL7Parser.getEncodingCharacterMap("")

then:
out.size() > 0
}

def "getEncodingCharacterMap uses default definitions if the encoding characters are null"() {
when:
def out = HL7Parser.getEncodingCharacterMap(null)

then:
out.size() > 0
}
}

0 comments on commit 2a157a7

Please sign in to comment.