Comments (5)
Thank you for your report, we have been using EVSE patches in our plateform without any issues. I will take a look into it
from ocpi-toolkit.
I wrote this test:
class MapperTests {
@Test
fun shouldProperlyMap() {
expectThat(
mapper.readValue<LocationPartial>(
"""{
"name": "Interparking Gent Zuid",
"last_updated": "2019-06-24T12:39:09Z"
}
""".trimIndent()
)
).isA<LocationPartial>()
expectThat(
mapper.readValue<LocationPartial>(
"{\n\"name\": \"Interparking Gent Zuid\",\n\"last_updated\": \"2019-06-24T12:39:09Z\"\n}"
)
).isA<LocationPartial>()
}
}
And it works. Have you got more details to share?
from ocpi-toolkit.
Maybe I'm doing something wrong, but I can't get your test to work 🤔
package com.izivia.ocpi.toolkit.common
import com.izivia.ocpi.toolkit.modules.locations.domain.LocationPartial
import org.junit.jupiter.api.Test
import strikt.api.expectThat
class MapperTest {
@Test
fun shouldProperlyMap() {
expectThat(
mapper.readValue<LocationPartial>(
"""{
"name": "Interparking Gent Zuid",
"last_updated": "2019-06-24T12:39:09Z"
}
""".trimIndent()
)
).isA<LocationPartial>()
expectThat(
mapper.readValue<LocationPartial>(
"{\n\"name\": \"Interparking Gent Zuid\",\n\"last_updated\": \"2019-06-24T12:39:09Z\"\n}"
)
).isA<LocationPartial>()
}
}
is generating the following error:
e: file:///home/.../ocpi-toolkit/ocpi-toolkit-2.2.1/src/test/kotlin/com/izivia/ocpi/toolkit/common/MapperTest.kt:22:20 None of the following functions can be called with the arguments supplied:
public final fun <T : Any!> readValue(p0: JsonParser!, p1: ResolvedType!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: JsonParser!, p1: TypeReference<TypeVariable(T)!>!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: JsonParser!, p1: JavaType!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: JsonParser!, p1: Class<TypeVariable(T)!>!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: DataInput!, p1: JavaType!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: DataInput!, p1: Class<TypeVariable(T)!>!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: File!, p1: TypeReference<TypeVariable(T)!>!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
public open fun <T : Any!> readValue(p0: File!, p1: JavaType!): TypeVariable(T)! defined in com.fasterxml.jackson.databind.ObjectMapper
...
from ocpi-toolkit.
The exception is thrown in this line:
from ocpi-toolkit.
Forget it. In my test I was JSON encoding a JSON encoded string before doing the real call to the server 🤦♂️
Sorry for that, and thanks for your time.
from ocpi-toolkit.
Related Issues (20)
- Request Parameter vs. Owned Object values validation
- DELETE endpoint of Credentials module HOT 1
- Credentials PUT/DELETE methods should return 405 METHOD NOT ALLOWED when the partner is not registered
- last_updated must be updated in EVSE and Location objects HOT 3
- Paginated response header override all other headers
- ContraintViolations are not built properly
- evseId should be optional
- Should we open the Service classes? HOT 1
- Add optional partyId / countryCode to all interfaces HOT 5
- Incorrect HTTP response codes. HOT 1
- CPO & eMSP vs. Sender & Receiver HOT 1
- Implementation of the ChargingProfiles module
- Using pagination HOT 8
- NullPointerException is thrown when pagination headers are missing HOT 1
- Missing Capabilities HOT 1
- IndexOutOfBoundsException is thrown if pagination header Link is present but empty
- (discussion) OcpiResponseBody fields in snake_case HOT 1
- date_from in Sessions Sender Interface must be required HOT 1
- twentyforseven should be "twentyforseven" not "twenty_for_seven" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocpi-toolkit.