File tree 6 files changed +14
-6
lines changed
test/java/com/incognia/api
6 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ dependencies {
43
43
implementation platform(" com.squareup.okhttp3:okhttp-bom:4.12.0" )
44
44
implementation " com.squareup.okhttp3:okhttp"
45
45
implementation " com.fasterxml.jackson.core:jackson-databind:2.17.1"
46
+ implementation " com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1"
46
47
47
48
testImplementation ' com.auth0:java-jwt:4.4.0'
48
49
testImplementation ' commons-io:commons-io:2.16.1'
Original file line number Diff line number Diff line change @@ -408,14 +408,14 @@ public void registerFeedback(
408
408
409
409
public void registerFeedback (
410
410
FeedbackEvent feedbackEvent ,
411
- Instant timestamp ,
411
+ Instant occurredAt ,
412
412
FeedbackIdentifiers identifiers ,
413
413
boolean dryRun )
414
414
throws IncogniaException {
415
415
PostFeedbackRequestBody requestBody =
416
416
PostFeedbackRequestBody .builder ()
417
417
.event (feedbackEvent )
418
- .timestamp ( timestamp . toEpochMilli () )
418
+ .occurredAt ( occurredAt )
419
419
.installationId (identifiers .getInstallationId ())
420
420
.sessionToken (identifiers .getSessionToken ())
421
421
.accountId (identifiers .getAccountId ())
Original file line number Diff line number Diff line change 4
4
import com .fasterxml .jackson .databind .DeserializationFeature ;
5
5
import com .fasterxml .jackson .databind .ObjectMapper ;
6
6
import com .fasterxml .jackson .databind .PropertyNamingStrategy ;
7
+ import com .fasterxml .jackson .databind .SerializationFeature ;
8
+ import com .fasterxml .jackson .datatype .jsr310 .JavaTimeModule ;
7
9
8
10
public class ObjectMapperFactory {
9
11
@ SuppressWarnings ("deprecation" )
10
12
// PropertyNamingStrategy.SNAKE_CASE is deprecated but we use it for compatibility with older
11
13
// jackson versions
12
14
public static final ObjectMapper OBJECT_MAPPER =
13
15
new ObjectMapper ()
16
+ .registerModule (new JavaTimeModule ())
14
17
.setPropertyNamingStrategy (PropertyNamingStrategy .SNAKE_CASE )
15
18
.setSerializationInclusion (Include .NON_NULL )
16
- .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false );
19
+ .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false )
20
+ .configure (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS , false );
17
21
}
Original file line number Diff line number Diff line change 1
1
package com .incognia .common ;
2
2
3
+ import java .time .Instant ;
3
4
import lombok .Builder ;
4
5
import lombok .Value ;
5
6
8
9
public class AdditionalLocation {
9
10
Double lat ;
10
11
Double lng ;
11
- Long timestamp ;
12
+ @ Deprecated Long timestamp ;
13
+ Instant collectedAt ;
12
14
}
Original file line number Diff line number Diff line change 1
1
package com .incognia .feedback ;
2
2
3
+ import java .time .Instant ;
3
4
import lombok .Builder ;
4
5
import lombok .Value ;
5
6
6
7
@ Value
7
8
@ Builder
8
9
public class PostFeedbackRequestBody {
9
10
FeedbackEvent event ;
10
- Long timestamp ;
11
+ Instant occurredAt ;
11
12
String accountId ;
12
13
String externalId ;
13
14
String installationId ;
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ void testRegisterFeedback_whenDataIsValid(boolean dryRun) {
556
556
.signupId (signupId )
557
557
.accountId (accountId )
558
558
.event (FeedbackEvent .ACCOUNT_TAKEOVER )
559
- .timestamp (timestamp . toEpochMilli () )
559
+ .occurredAt (timestamp )
560
560
.build ());
561
561
mockServer .setDispatcher (dispatcher );
562
562
client .registerFeedback (
You can’t perform that action at this time.
0 commit comments