Skip to content

Commit

Permalink
one of HmsSettings apply functions recurses indefinitely (huawei-push…
Browse files Browse the repository at this point in the history
…-kit) (#142)

* one of HmsSettings apply functions recurses indefinitely

* Create HmsSettingsSpec.scala

* Update HmsSettingsSpec.scala
  • Loading branch information
pjfanning committed Jun 8, 2023
1 parent f16b644 commit 8b157df
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ object HmsSettings {
def apply(
appId: String,
appSecret: String,
forwardProxy: Option[ForwardProxy]): HmsSettings = apply(appId, appSecret, forwardProxy)
forwardProxy: Option[ForwardProxy]): HmsSettings =
apply(appId, appSecret, IsTest, MaxConcurrentConnections, forwardProxy)

/**
* Java API.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* This file is part of the Apache Pekko project, derived from Akka.
*/

package org.apache.pekko.stream.connectors.huawei.pushkit

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class HmsSettingsSpec extends AnyWordSpec with Matchers {
"HmsSettings" must {
"have an apply that does not recurse indefinitely" in {
val hmsSettings = HmsSettings("id1", "secret1", None)
hmsSettings should equal(HmsSettings(hmsSettings.appId, hmsSettings.appSecret, false, 50, None))
}
}
}

0 comments on commit 8b157df

Please sign in to comment.