-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix schemaVersion regex not matching for complete attribute value
- Loading branch information
1 parent
1fed64c
commit 559f2ff
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/test/java/com/io/openepcis/version/VersionDetectorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.io.openepcis.version; | ||
|
||
import io.openepcis.constants.EPCISVersion; | ||
import io.openepcis.convert.VersionTransformer; | ||
import io.openepcis.resources.util.Commons; | ||
import jakarta.xml.bind.JAXBException; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.BufferedInputStream; | ||
import java.io.IOException; | ||
|
||
public class VersionDetectorTest { | ||
private final VersionTransformer versionTransformer; | ||
|
||
public VersionDetectorTest() throws JAXBException { | ||
versionTransformer = new VersionTransformer(); | ||
} | ||
|
||
@Test | ||
void testJSON_2_0_0() throws IOException { | ||
final EPCISVersion version = versionTransformer.versionDetector(new BufferedInputStream(Commons.getInputStream("2.0/EPCIS/JSON/Capture/Documents/Combination_of_different_event.json"))); | ||
Assertions.assertEquals(EPCISVersion.VERSION_2_0_0, version); | ||
} | ||
|
||
@Test | ||
void testXML_2_0_0() throws IOException { | ||
final EPCISVersion version = versionTransformer.versionDetector(new BufferedInputStream(Commons.getInputStream("2.0/EPCIS/XML/Capture/Documents/Combination_of_different_event.xml"))); | ||
Assertions.assertEquals(EPCISVersion.VERSION_2_0_0, version); | ||
} | ||
|
||
@Test | ||
void testXML_1_2_0() throws IOException { | ||
final EPCISVersion version = versionTransformer.versionDetector(new BufferedInputStream(Commons.getInputStream("1.2/EPCIS/XML/Capture/Documents/ObjectEvent.xml"))); | ||
Assertions.assertEquals(EPCISVersion.VERSION_1_2_0, version); | ||
} | ||
// new String(Commons.getInputStream("2.0/EPCIS/JSON/Capture/Documents/Combination_of_different_event.json").readAllBytes(), StandardCharsets.UTF_8); | ||
} |