-
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
Fix compile warnings in mantis-control-plane-server #417
Conversation
* Remove deprecated bindAndHandle * Remove deprecated Mockito.Matchers and replace with ArgumentMatchers * Remove deprecated ActorMaterializer and replace with Materializer * Remove deprecated startPeriodicTimer and replace with startTimerAtFixedRate * Fix serialization of Optional in unit tests * Replace DatatypeConverter with BaseEncoding
import lombok.Value; | ||
import org.apache.flink.shaded.guava30.com.google.common.io.BaseEncoding; |
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.
@@ -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 comment
The 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 comment
The 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/).
I thought setting the (inteliJ IDEA) File -> Project Structure- > Language level to 8 would be sufficient, however it dosent seem that way.
JDK 8 evaluates:
objectMapper.writeValueAsString(Optional.empty())
as {"present":false}
JDK 11 evaluates:
objectMapper.writeValueAsString(Optional.empty())
as {empty":true,"present":false}
Similarly:
objectMapper.writeValueAsString(Optional.of("test"))
evaluates to {"empty":false,"present":true}
I will undo this change since sourceCompatibility is set Java 8
* Switch BaseEncoding.base16 to use mantisrx.shaded import
Test Results 82 files - 44 82 suites - 44 2m 9s ⏱️ - 4m 7s For more details on these failures, see this check. Results for commit 9e754ac. ± Comparison against base commit 6fc313e. This pull request removes 119 tests.
|
@itsharis please rebase to latest master and get a clean CI run. |
Not sure if this was the right approach: If not, please advise what is the best way to do this. |
Context
Progress towards: [#392]
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all testsNote: There are more fixes for for this module, however but i am splitting them up so they are in a more consumable format