-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compile warnings in mantis-control-plane-server #417
Changes from 1 commit
347a06a
9e754ac
8a8bbf9
ebd6d96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,16 +67,16 @@ public void testDeser4() throws IOException { | |
mwm.setCluster(Optional.of("test")); | ||
|
||
final String out = objectMapper.writer(Jackson.DEFAULT_FILTER_PROVIDER).writeValueAsString(mwm); | ||
assertTrue(out.contains("\"cluster\":{\"present\":true},")); | ||
assertTrue(out.contains("\"cluster\":{\"empty\":false,\"present\":true}")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where and why is this "empty" key introduced? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to do some digging into this. This is a difference with jakson on JDK 8 vs JDK 11 (JDK i am using on M1: https://adoptium.net/download/). Similarly: |
||
final String serializeAgain = objectMapper.writeValueAsString(objectMapper.readValue(out, MantisWorkerMetadataWritable.class)); | ||
assertFalse(serializeAgain.contains("\"cluster\":{\"present\":true},")); | ||
assertTrue(serializeAgain.contains("\"cluster\":{\"present\":false},")); | ||
assertFalse(serializeAgain.contains("\"cluster\":{\"empty\":false,\"present\":true},")); | ||
assertTrue(serializeAgain.contains("\"cluster\":{\"empty\":true,\"present\":false},")); | ||
} | ||
|
||
@Test | ||
public void testOptionalSerialization() throws JsonProcessingException { | ||
assertEquals("{\"present\":false}", objectMapper.writeValueAsString(Optional.empty())); | ||
assertEquals("{\"present\":true}", objectMapper.writeValueAsString(Optional.of("test"))); | ||
assertEquals("{\"empty\":true,\"present\":false}", objectMapper.writeValueAsString(Optional.empty())); | ||
assertEquals("{\"empty\":false,\"present\":true}", objectMapper.writeValueAsString(Optional.of("empty"))); | ||
} | ||
|
||
@Test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea to use the Flink-shaded version of guava. There is a mantis-shaded version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks i will make this change.