Skip to content

Commit

Permalink
Merge pull request #67 from IZIVIA/fix/IDEV-3942-fix-phase-enum-parsing
Browse files Browse the repository at this point in the history
fix: IDEV-3942 fix phase enum mapping missing in ocpp 1.6 soap
  • Loading branch information
DeborahPereira4sh authored Mar 28, 2024
2 parents ba3e898 + 2bddc9d commit ed85bf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ internal object Ocpp16SoapMapperIn : ObjectMapper(
OcppSoapMapper()
.addMixIn(ReadingContext::class.java, EnumMixin::class.java)
.addMixIn(Measurand::class.java, EnumMixin::class.java)
.addMixIn(Phase::class.java, EnumMixin::class.java)
)

internal object Ocpp16SoapMapper : ObjectMapper(
OcppSoapMapper()
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.addMixIn(Measurand::class.java, EnumMixin::class.java)
.addMixIn(Phase::class.java, EnumMixin::class.java)
.addMixIn(IdTagInfo::class.java, IdTagInfoMixin::class.java)
.addMixIn(ReadingContext::class.java, EnumMixin::class.java)
.addMixIn(AuthorizeResp::class.java, AuthorizeRespMixin::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ class Ocpp16SoapParserTest {
<ocpp:measurand>Energy.Active.Import.Register</ocpp:measurand>
<ocpp:unit>Wh</ocpp:unit>
<ocpp:value>15213716</ocpp:value>
<ocpp:phase>L1-N</ocpp:phase>
</ocpp:sampledValue>
</ocpp:meterValue>
</ocpp:meterValuesRequest>
Expand All @@ -434,7 +435,7 @@ class Ocpp16SoapParserTest {
get { format }.isEqualTo(ValueFormat.Raw)
get { location }.isEqualTo(Location.Inlet)
get { measurand }.isEqualTo(Measurand.EnergyActiveImportRegister)
get { phase }.isNull()
get { phase }.isEqualTo(Phase.L1N)
get { unit }.isEqualTo(UnitOfMeasure.Wh)
}
}
Expand Down

0 comments on commit ed85bf4

Please sign in to comment.