-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mock sfera communication and add example JP and SP (#323)
- Loading branch information
1 parent
11ed6ce
commit d44a434
Showing
60 changed files
with
8,551 additions
and
8,051 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# default reviewers | ||
* @mghilardelli @Grodien | ||
* @mghilardelli @Grodien @rawi-coding |
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
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
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
23 changes: 0 additions & 23 deletions
23
sfera-mock/src/main/java/ch/sbb/sferamock/messages/MessageListener.java
This file was deleted.
Oops, something went wrong.
112 changes: 0 additions & 112 deletions
112
sfera-mock/src/main/java/ch/sbb/sferamock/messages/SferaHandler.java
This file was deleted.
Oops, something went wrong.
93 changes: 0 additions & 93 deletions
93
sfera-mock/src/main/java/ch/sbb/sferamock/messages/StaticSferaService.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
sfera-mock/src/main/java/ch/sbb/sferamock/messages/common/SferaErrorCodes.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,23 @@ | ||
package ch.sbb.sferamock.messages.common; | ||
|
||
public enum SferaErrorCodes { | ||
|
||
SFERA_XSD_VERSION_NOT_SUPPORTED("2"), | ||
INTENDED_RECIPIENT_NOT_ACTUAL_RECIPIENT("7"), | ||
XML_SCHEMA_VIOLATION("13"), | ||
ACTION_NOT_AUTHORIZED_FOR_USER("46"), | ||
DATA_TEMPORARILY_UNAVAILABLE("48"), | ||
COULD_NOT_PROCESS_DATA("50"), | ||
INCONSISTENT_DATA("53"); | ||
|
||
final String code; | ||
|
||
SferaErrorCodes(String code) { | ||
this.code = code; | ||
} | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
sfera-mock/src/main/java/ch/sbb/sferamock/messages/common/XmlDateHelper.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,39 @@ | ||
package ch.sbb.sferamock.messages.common; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import javax.xml.datatype.DatatypeConfigurationException; | ||
import javax.xml.datatype.DatatypeConstants; | ||
import javax.xml.datatype.DatatypeFactory; | ||
import javax.xml.datatype.XMLGregorianCalendar; | ||
|
||
public final class XmlDateHelper { | ||
|
||
private XmlDateHelper() { | ||
} | ||
|
||
public static XMLGregorianCalendar toGregorianCalender(LocalDateTime localDateTime) { | ||
try { | ||
return DatatypeFactory.newInstance().newXMLGregorianCalendar( | ||
localDateTime.getYear(), localDateTime.getMonth().getValue(), localDateTime.getDayOfMonth(), | ||
localDateTime.getHour(), localDateTime.getMinute(), localDateTime.getSecond(), | ||
DatatypeConstants.FIELD_UNDEFINED, 0); | ||
} catch (DatatypeConfigurationException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public static XMLGregorianCalendar toGregorianCalender(LocalDate localDate) { | ||
try { | ||
return DatatypeFactory.newInstance().newXMLGregorianCalendarDate( | ||
localDate.getYear(), localDate.getMonthValue(), localDate.getDayOfMonth(), | ||
DatatypeConstants.FIELD_UNDEFINED); | ||
} catch (DatatypeConfigurationException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public static LocalDate toLocalDate(XMLGregorianCalendar calendar) { | ||
return LocalDate.of(calendar.getYear(), calendar.getMonth(), calendar.getDay()); | ||
} | ||
} |
Oops, something went wrong.