Skip to content

Commit

Permalink
Implicit definition should have explicit type - fewMore
Browse files Browse the repository at this point in the history
  • Loading branch information
Arikuti committed Sep 4, 2023
1 parent bf65a4c commit 5ab05df
Show file tree
Hide file tree
Showing 32 changed files with 105 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import scala.concurrent.duration._

class EventBridgePublisherSpec extends AnyFlatSpec with Matchers with ScalaFutures with IntegrationTestContext {

implicit val defaultPatience =
implicit val defaultPatience: PatienceConfig =
PatienceConfig(timeout = 15.seconds, interval = 100.millis)

"EventBridge Publisher sink" should "send PutEventsEntry message" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import scala.collection.mutable.Queue
setHandler(
out,
new OutHandler {
override def onPull: Unit =
override def onPull(): Unit =
if (!buffer.isEmpty) {
push(out, buffer.dequeue())
} else {
Expand Down
6 changes: 3 additions & 3 deletions ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpLike.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ protected[ftp] trait UnconfirmedReads { _: FtpLike[_, _] =>
@InternalApi
object FtpLike {
// type class instances
implicit val ftpLikeInstance = new FtpLike[FTPClient, FtpSettings] with RetrieveOffset with FtpOperations
implicit val ftpsLikeInstance = new FtpLike[FTPSClient, FtpsSettings] with RetrieveOffset with FtpsOperations
implicit val sFtpLikeInstance =
implicit val ftpLikeInstance: FtpLike[FTPClient, FtpSettings] with RetrieveOffset with FtpOperations = new FtpLike[FTPClient, FtpSettings] with RetrieveOffset with FtpOperations
implicit val ftpsLikeInstance: FtpLike[FTPSClient, FtpsSettings] with RetrieveOffset with FtpsOperations = new FtpLike[FTPSClient, FtpsSettings] with RetrieveOffset with FtpsOperations
implicit val sFtpLikeInstance: FtpLike[SSHClient, SftpSettings] with RetrieveOffset with SftpOperations with UnconfirmedReads =
new FtpLike[SSHClient, SftpSettings] with RetrieveOffset with SftpOperations with UnconfirmedReads
}
2 changes: 1 addition & 1 deletion geode/src/test/scala/docs/scaladsl/GeodeBaseSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.scalatest.wordspec.AnyWordSpec

class GeodeBaseSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with LogCapturing {

implicit val system = ActorSystem("test")
implicit val system: ActorSystem = ActorSystem("test")

//#region
val personsRegionSettings: RegionSettings[Int, Person] = RegionSettings("persons", (p: Person) => p.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ trait BigQueryCollectionFormats {
import collection.{immutable => imm}

implicit def immIterableFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[immutable.Iterable[T]] = viaSeq[imm.Iterable[T], T](seq => imm.Iterable(seq: _*))
implicit def immSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[Seq[T]] = viaSeq[imm.Seq[T], T](seq => imm.Seq(seq: _*))
implicit def immIndexedSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[IndexedSeq[T]] = viaSeq[imm.IndexedSeq[T], T](seq => imm.IndexedSeq(seq: _*))
implicit def immLinearSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[LinearSeq[T]] = viaSeq[imm.LinearSeq[T], T](seq => imm.LinearSeq(seq: _*))
implicit def vectorFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[Vector[T]] = viaSeq[Vector[T], T](seq => Vector(seq: _*))
implicit def immSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[imm.Seq[T]] = viaSeq[imm.Seq[T], T](seq => imm.Seq(seq: _*))
implicit def immIndexedSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[imm.IndexedSeq[T]] = viaSeq[imm.IndexedSeq[T], T](seq => imm.IndexedSeq(seq: _*))
implicit def immLinearSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[imm.LinearSeq[T]] = viaSeq[imm.LinearSeq[T], T](seq => imm.LinearSeq(seq: _*))
implicit def vectorFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[imm.Vector[T]] = viaSeq[imm.Vector[T], T](seq => imm.Vector(seq: _*))

import collection._

implicit def iterableFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[Iterable[T]] = viaSeq[Iterable[T], T](seq => Iterable(seq: _*))
implicit def seqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[Seq[T]] = viaSeq[Seq[T], T](seq => Seq(seq: _*))
implicit def indexedSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[IndexedSeq[T]] = viaSeq[IndexedSeq[T], T](seq => IndexedSeq(seq: _*))
implicit def linearSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[Any] = viaSeq[LinearSeq[T], T](seq => LinearSeq(seq: _*))
implicit def iterableFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[collection.Iterable[T]] = viaSeq[collection.Iterable[T], T](seq => collection.Iterable(seq: _*))
implicit def seqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[collection.Seq[T]] = viaSeq[collection.Seq[T], T](seq => collection.Seq(seq: _*))
implicit def indexedSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[collection.IndexedSeq[T]] = viaSeq[collection.IndexedSeq[T], T](seq => collection.IndexedSeq(seq: _*))
implicit def linearSeqFormat[T: BigQueryJsonFormat]: BigQueryJsonFormat[collection.LinearSeq[T]] = viaSeq[collection.LinearSeq[T], T](seq => collection.LinearSeq(seq: _*))

/**
* A BigQueryJsonFormat construction helper that creates a BigQueryJsonFormat for an Iterable type I from a builder function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

package akka.stream.alpakka.googlecloud.bigquery.scaladsl.spray

import spray.json.{deserializationError, DefaultJsonProtocol, JsNumber, JsValue, JsonFormat}
import spray.json
import spray.json.{DefaultJsonProtocol, JsNumber, JsValue, JsonFormat, deserializationError}

import scala.concurrent.duration.{DurationLong, FiniteDuration}

Expand All @@ -13,18 +14,18 @@ import scala.concurrent.duration.{DurationLong, FiniteDuration}
*/
trait BigQueryRestBasicFormats {

implicit val IntJsonFormat = DefaultJsonProtocol.IntJsonFormat
implicit val FloatJsonFormat = DefaultJsonProtocol.FloatJsonFormat
implicit val DoubleJsonFormat = DefaultJsonProtocol.DoubleJsonFormat
implicit val ByteJsonFormat = DefaultJsonProtocol.ByteJsonFormat
implicit val ShortJsonFormat = DefaultJsonProtocol.ShortJsonFormat
implicit val BigDecimalJsonFormat = DefaultJsonProtocol.BigDecimalJsonFormat
implicit val BigIntJsonFormat = DefaultJsonProtocol.BigIntJsonFormat
implicit val UnitJsonFormat = DefaultJsonProtocol.UnitJsonFormat
implicit val BooleanJsonFormat = DefaultJsonProtocol.BooleanJsonFormat
implicit val CharJsonFormat = DefaultJsonProtocol.CharJsonFormat
implicit val StringJsonFormat = DefaultJsonProtocol.StringJsonFormat
implicit val SymbolJsonFormat = DefaultJsonProtocol.SymbolJsonFormat
implicit val IntJsonFormat: json.DefaultJsonProtocol.IntJsonFormat.type = DefaultJsonProtocol.IntJsonFormat
implicit val FloatJsonFormat: _root_.spray.json.DefaultJsonProtocol.FloatJsonFormat.type = DefaultJsonProtocol.FloatJsonFormat
implicit val DoubleJsonFormat: _root_.spray.json.DefaultJsonProtocol.DoubleJsonFormat.type = DefaultJsonProtocol.DoubleJsonFormat
implicit val ByteJsonFormat: _root_.spray.json.DefaultJsonProtocol.ByteJsonFormat.type = DefaultJsonProtocol.ByteJsonFormat
implicit val ShortJsonFormat: _root_.spray.json.DefaultJsonProtocol.ShortJsonFormat.type = DefaultJsonProtocol.ShortJsonFormat
implicit val BigDecimalJsonFormat: _root_.spray.json.DefaultJsonProtocol.BigDecimalJsonFormat.type = DefaultJsonProtocol.BigDecimalJsonFormat
implicit val BigIntJsonFormat: _root_.spray.json.DefaultJsonProtocol.BigIntJsonFormat.type = DefaultJsonProtocol.BigIntJsonFormat
implicit val UnitJsonFormat: _root_.spray.json.DefaultJsonProtocol.UnitJsonFormat.type = DefaultJsonProtocol.UnitJsonFormat
implicit val BooleanJsonFormat: _root_.spray.json.DefaultJsonProtocol.BooleanJsonFormat.type = DefaultJsonProtocol.BooleanJsonFormat
implicit val CharJsonFormat: _root_.spray.json.DefaultJsonProtocol.CharJsonFormat.type = DefaultJsonProtocol.CharJsonFormat
implicit val StringJsonFormat: _root_.spray.json.DefaultJsonProtocol.StringJsonFormat.type = DefaultJsonProtocol.StringJsonFormat
implicit val SymbolJsonFormat: _root_.spray.json.DefaultJsonProtocol.SymbolJsonFormat.type = DefaultJsonProtocol.SymbolJsonFormat

implicit object BigQueryLongJsonFormat extends JsonFormat[Long] {
def write(x: Long) = JsNumber(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import scala.concurrent.duration._

class GooglePubSubSpec extends AnyFlatSpec with ScalaFutures with Matchers with LogCapturing with BeforeAndAfterAll {

implicit val defaultPatience =
implicit val defaultPatience: PatienceConfig =
PatienceConfig(timeout = 5.seconds, interval = 100.millis)

implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()

override protected def afterAll(): Unit = {
TestKit.shutdownActorSystem(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NoopTrustManager extends X509TrustManager {

class PubSubApiSpec extends AnyFlatSpec with BeforeAndAfterAll with ScalaFutures with Matchers with LogCapturing {

implicit val system = ActorSystem(
implicit val system: ActorSystem = ActorSystem(
"PubSubApiSpec",
ConfigFactory
.parseString(
Expand All @@ -52,7 +52,7 @@ class PubSubApiSpec extends AnyFlatSpec with BeforeAndAfterAll with ScalaFutures
.withFallback(ConfigFactory.load())
)

implicit val defaultPatience =
implicit val defaultPatience: PatienceConfig =
PatienceConfig(timeout = 5.seconds, interval = 100.millis)

def createInsecureSslEngine(host: String, port: Int): SSLEngine = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import scala.concurrent.{Future, Promise}
class ExampleUsage {

//#init-system
implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()
val config = PubSubConfig()
val topic = "topic1"
val subscription = "subscription1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}

import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContextExecutor}
import scala.concurrent.duration._

trait WithMaterializerGlobal
Expand All @@ -20,8 +20,8 @@ trait WithMaterializerGlobal
with ScalaFutures
with IntegrationPatience
with Matchers {
implicit val actorSystem = ActorSystem("test")
implicit val ec = actorSystem.dispatcher
implicit val actorSystem: ActorSystem = ActorSystem("test")
implicit val ec: ExecutionContextExecutor = actorSystem.dispatcher

override protected def afterAll(): Unit = {
super.afterAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PaginatedRequestSpec
super.afterAll()
}

implicit val patience = PatienceConfig(remainingOrDefault)
implicit val patience: PatienceConfig = PatienceConfig(remainingOrDefault)
implicit val paginated: Paginated[JsValue] = _.asJsObject.fields.get("pageToken").flatMap {
case JsString(value) => Some(value)
case _ => None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import akka.actor.ActorSystem
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.HttpMethods.POST
import akka.http.scaladsl.model.{ContentTypes, HttpRequest, Uri}
import akka.http.scaladsl.unmarshalling.Unmarshaller
import akka.http.scaladsl.unmarshalling.{FromResponseUnmarshaller, Unmarshaller}
import akka.stream.alpakka.google.scaladsl.`X-Upload-Content-Type`
import akka.stream.scaladsl.Source
import akka.testkit.TestKit
Expand All @@ -30,7 +30,7 @@ class ResumableUploadSpec
with ScalaFutures
with HoverflySupport {

implicit val patience = PatienceConfig(remainingOrDefault)
implicit val patience: PatienceConfig = PatienceConfig(remainingOrDefault)

override def afterAll(): Unit = {
TestKit.shutdownActorSystem(system)
Expand Down Expand Up @@ -71,7 +71,7 @@ class ResumableUploadSpec
)

import implicits._
implicit val um =
implicit val um: FromResponseUnmarshaller[JsValue] =
Unmarshaller.messageUnmarshallerFromEntityUnmarshaller(sprayJsValueUnmarshaller).withDefaultRetry

val result = Source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package akka.stream.alpakka.google.auth

import akka.actor.ActorSystem
import akka.stream.alpakka.google.{GoogleSettings, HoverflySupport}
import akka.stream.alpakka.google.{GoogleSettings, HoverflySupport, RequestSettings}
import akka.testkit.TestKit
import io.specto.hoverfly.junit.core.SimulationSource.dsl
import io.specto.hoverfly.junit.core.model.RequestFieldMatcher.newRegexMatcher
Expand All @@ -32,11 +32,11 @@ class GoogleOAuth2Spec
TestKit.shutdownActorSystem(system)
super.afterAll()
}
implicit val defaultPatience = PatienceConfig(remainingOrDefault)
implicit val defaultPatience: PatienceConfig = PatienceConfig(remainingOrDefault)

implicit val executionContext: ExecutionContext = system.dispatcher
implicit val settings = GoogleSettings(system)
implicit val clock = Clock.systemUTC()
implicit val settings: GoogleSettings = GoogleSettings(system)
implicit val clock: Clock = Clock.systemUTC()

lazy val privateKey = {
val inputStream = getClass.getClassLoader.getResourceAsStream("private_pcks8.pem")
Expand Down Expand Up @@ -65,7 +65,7 @@ class GoogleOAuth2Spec
)
)

implicit val settings = GoogleSettings().requestSettings
implicit val settings: RequestSettings = GoogleSettings().requestSettings
GoogleOAuth2.getAccessToken("email", privateKey, scopes).futureValue should matchPattern {
case AccessToken("token", exp) if exp > (System.currentTimeMillis / 1000L + 3000L) =>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class OAuth2CredentialsSpec
}

import system.dispatcher
implicit val settings = GoogleSettings().requestSettings
implicit val clock = Clock.systemUTC()
implicit val settings: RequestSettings = GoogleSettings().requestSettings
implicit val clock: Clock = Clock.systemUTC()

final object AccessTokenProvider {
@volatile var accessTokenPromise: Promise[AccessToken] = Promise.failed(new RuntimeException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class GoogleHttpSpec
http
}

implicit val settings = GoogleSettings().requestSettings
implicit val settings: RequestSettings = GoogleSettings().requestSettings

"GoogleHttp" must {

Expand Down Expand Up @@ -160,7 +160,7 @@ class GoogleHttpSpec
Future.failed(GoogleOAuth2Exception(ErrorInfo())),
Future.failed(new AnotherException)
)
implicit val settingsWithMockedCredentials = GoogleSettings().copy(credentials = credentials)
implicit val settingsWithMockedCredentials: GoogleSettings = GoogleSettings().copy(credentials = credentials)

val http = mockHttp
when(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class FcmSenderSpec
override def afterAll(): Unit =
TestKit.shutdownActorSystem(system)

implicit val defaultPatience =
implicit val defaultPatience: PatienceConfig =
PatienceConfig(timeout = 2.seconds, interval = 50.millis)

implicit val executionContext: ExecutionContext = system.dispatcher

implicit val conf = FcmSettings()
implicit val settings = GoogleSettings().copy(projectId = "projectId")
implicit val conf: FcmSettings = FcmSettings()
implicit val settings: GoogleSettings = GoogleSettings().copy(projectId = "projectId")

"FcmSender" should {

Expand Down
2 changes: 1 addition & 1 deletion influxdb/src/test/scala/docs/scaladsl/FlowSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FlowSpec
with ScalaFutures
with LogCapturing {

implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()

final val DatabaseName = this.getClass.getSimpleName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.util.{Failure, Success}

class JmsAckConnectorsSpec extends JmsSpec {

override implicit val patienceConfig = PatienceConfig(2.minutes)
override implicit val patienceConfig: PatienceConfig = PatienceConfig(2.minutes)

"The JMS Ack Connectors" should {
"publish and consume strings through a queue" in withConnectionFactory() { connectionFactory =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scala.util.{Failure, Success}

class JmsBufferedAckConnectorsSpec extends JmsSharedServerSpec {

override implicit val patienceConfig = PatienceConfig(2.minutes)
override implicit val patienceConfig: PatienceConfig = PatienceConfig(2.minutes)

"The JMS Ack Connectors" should {
"publish and consume strings through a queue" in withConnectionFactory() { connectionFactory =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.concurrent.duration._
import scala.concurrent.Future

class JmsIbmmqConnectorsSpec extends JmsSpec {
override implicit val patienceConfig = PatienceConfig(2.minutes)
override implicit val patienceConfig: PatienceConfig = PatienceConfig(2.minutes)

"The JMS Ibmmq Connectors" should {
val queueConnectionFactory = {
Expand Down
2 changes: 1 addition & 1 deletion jms/src/test/scala/docs/scaladsl/JmsTxConnectorsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class JmsTxConnectorsSpec extends JmsSharedServerSpec {

private final val log = LoggerFactory.getLogger(classOf[JmsTxConnectorsSpec])

override implicit val patienceConfig = PatienceConfig(2.minutes)
override implicit val patienceConfig: PatienceConfig = PatienceConfig(2.minutes)

"The JMS Transactional Connectors" should {
"publish and consume strings through a queue" in withConnectionFactory() { connectionFactory =>
Expand Down
2 changes: 1 addition & 1 deletion mongodb/src/test/scala/docs/scaladsl/MongoSinkSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MongoSinkSpec
val codecRegistry =
fromRegistries(fromProviders(classOf[Number], classOf[DomainObject]), DEFAULT_CODEC_REGISTRY)

implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()

override implicit val patienceConfig: PatienceConfig =
PatienceConfig(timeout = 10.seconds, interval = 100.millis)
Expand Down
2 changes: 1 addition & 1 deletion mongodb/src/test/scala/docs/scaladsl/MongoSourceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MongoSourceSpec
with LogCapturing {

// #init-system
implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()
// #init-system

override implicit val patienceConfig: PatienceConfig =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

package docs.scaladsl

import akka.actor
import akka.actor.typed.ActorSystem
import akka.actor.typed.scaladsl.Behaviors
import akka.stream.alpakka.mqtt.streaming.MqttSessionSettings
import akka.stream.alpakka.mqtt.streaming.scaladsl.{ActorMqttClientSession, ActorMqttServerSession}
import org.scalatest.wordspec.AnyWordSpec

class MqttTypedActorSystemSpec extends AnyWordSpec {

implicit val actorSystem = akka.actor.typed.ActorSystem(Behaviors.ignore, "MqttTypedActorSystemSpec")
implicit val actorSystem: ActorSystem[Nothing] = akka.actor.typed.ActorSystem(Behaviors.ignore, "MqttTypedActorSystemSpec")

"A typed actor system" should {
"allow client creation" in {
Expand All @@ -31,7 +33,7 @@ class MqttTypedActorSystemSpec extends AnyWordSpec {

class MqttClassicActorSystemSpec extends AnyWordSpec {

implicit val actorSystem = akka.actor.ActorSystem("MqttClassicActorSystemSpec")
implicit val actorSystem: actor.ActorSystem = akka.actor.ActorSystem("MqttClassicActorSystemSpec")

"A typed actor system" should {
"allow client creation" in {
Expand Down
Loading

0 comments on commit 5ab05df

Please sign in to comment.