Skip to content
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

Less use of deprecated APIs in Java code #2413

Merged
merged 1 commit into from
Sep 16, 2020
Merged

Conversation

ennru
Copy link
Member

@ennru ennru commented Sep 16, 2020

tests: use Hamcrest's assertThat
JMS tests: expect connection to be closed eventually
File tests: Check that the file exists, eventually on Travis
Slick test: recover -> recoverWithRetries

A part of #2410

tests: use Hamcrest's assertThat
JMS tests: expect connection to be closed eventually
File tests: Check that the file exists, eventually on Travis
Slick test: recover -> recoverWithRetries
Copy link
Member

@seglo seglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A few comments.

@@ -5,7 +5,11 @@
package akka.stream.alpakka.amqp.javadsl;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] Why hamcrest's assertThat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JUnit variant is deprecated nowadays.

@@ -539,7 +539,7 @@ class JmsConnectorsSpec extends JmsSpec {
val completionFuture: Future[Done] = Source(msgsIn).runWith(jmsSink)
completionFuture.futureValue shouldBe Done
// make sure connection was closed
connectionFactory.cachedConnection shouldBe 'closed
eventually { connectionFactory.cachedConnection shouldBe Symbol("closed") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] Don't like the symbol shorthand?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's deprecated in Scala 2.13.

Comment on lines +71 to 74
private static ActorSystem setupSystem() {
final ActorSystem system = ActorSystem.create("MqttFlowTest");
final Materializer materializer = ActorMaterializer.create(system);
return Pair.create(system, materializer);
return system;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] Don't really need this method anymore.

@@ -194,7 +190,8 @@ lazy val googleCloudPubSubGrpc = alpakkaProject(
"-P:silencer:pathFilters=akka-grpc/main",
"-P:silencer:pathFilters=akka-grpc/test"
),
crossScalaVersions --= Seq(Dependencies.Scala211) // 2.11 is not supported since Akka gRPC 0.6
compile / javacOptions := (compile / javacOptions).value.filterNot(_ == "-Xlint:deprecation"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] This effectively just sets -Xlint:unchecked. We could set this setting to that instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we might want to add more linting in Common.

@ennru ennru added this to the 2.0.2 milestone Sep 16, 2020
@ennru ennru merged commit 13a146c into akka:master Sep 16, 2020
@ennru ennru deleted the deprecations branch September 16, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants