1,616 questions
0
votes
0
answers
48
views
Specifying ScalaTest options with Mill
I really want to see full stack traces instead of the default cut-off ones when using ScalaTest, as explained here.
Yet I'm using mill 0.11.7.
Presumably you can specify ScalaTest arguments by passing ...
0
votes
0
answers
38
views
Getting org.powermock.api.mockito.ClassNotPreparedException, class is not prepared for test
Original Scala Code, the method in the XYZ class and OauthProvider:
Here we are trying to test a static method. At first, you may see the original code and then you can see that how I have written the ...
0
votes
1
answer
93
views
doobie tests exceeding db max connections
I have a small app consisting of a bunch of CRUD APIs towards a Postgres DB.
I have a bunch of DAOs and I have been using the doobie check functionality to type check my SQL statements and that has ...
0
votes
2
answers
147
views
scalatest: how to make multiple conditional assertions in async specs
First, I need this async test to get compiled.
Second, some assertions are made conditionally, depending on whether options are defined, while others are not.
Third, I'd like the test to fail fast, ...
1
vote
1
answer
64
views
How to rollback a skunk transaction for integration tests? (missing implicit Origin)
I'm writing integration tests of skunk code against postgres using scala-test-containers, munit and munit-cats-effect, using Mill and Scala 3. I'm new to Cats Effect.
The setup I'm working to achieve ...
0
votes
0
answers
72
views
Scala-cli test doesnt exit after test run
I have some basic tests that i am executing with scala cli. When i run the tests scala-cli test core where core is the name of the directory where the tests are. the test run is finished but the ...
0
votes
1
answer
128
views
com.holdenkarau.spark.testing - java.lang.NoSuchFieldError: METASTOREURIS
I have a spark scala application, it uses the below versions.
Dependencies:
org.apache.spark:spark-core_2.12:jar:3.3.2
org.apache.spark:spark-hive_2.12:jar:3.3.2
org.apache.hive:hive-common:jar:2.3.9
...
2
votes
0
answers
82
views
How can I resolve Guice/MissingImplementation error when it seems like there is an implementation?
In my test:
package com.megafarad.play.kafka.module
import com.google.inject.name.Names
import com.megafarad.play.kafka.services.KafkaProducerService
import io.github.embeddedkafka.EmbeddedKafka
...
0
votes
1
answer
126
views
scala How can I make a test lenient with idiomatic mockito
Here is the code being tested:
import concurrent.{ExecutionContext, Future}
trait Backend {
def verifyUser(): Future[Unit]
def accounts(): Future[String]
}
class Service(backend: Backend) {
...
0
votes
1
answer
54
views
scala-cli test are not run with scalacheck
I use scala-cli and scalatest-funsuite. Here is the snippet
//> using scala 3.3.3
//> using test.dep org.scalatest::scalatest-funsuite:3.2.19
//> using test.dep org.scalatestplus::scalacheck-...
0
votes
0
answers
107
views
Scalatest 3.0.8 PrivateMethodTester can't find private method named X
I have a base class that has a protected method called "validateOptPwd". This gets inherited in a test and then called via PrivateMethodTester.
val validateOptPwdMethod: PrivateMethod[Future[...
0
votes
0
answers
59
views
Unable to mock Scala object
I have started working in Scala very recently. I have below code in the main method that I'll need to mock for writing test cases,
object SacSAAgentSoftwareLogParser extends SparkSessionCreation {
...
1
vote
0
answers
51
views
Exclude by tag annotation not working for scalatestplus TestNGSuite in Java
I am trying to build a SBT project which will encompass both unit and end-to-end tests, and will support tests being written in both Scala (extending standard Scalatest suites, e.g. AnyFlatSpec) and ...
1
vote
1
answer
72
views
IntelliJ IDEA + Scala: how to navigate to broken test easily
I have construct like this in my Scala tests:
class ExpressionsTest extends AnyFunSpec {
describe("simple literals") {
describe("valid") {
it("123") {
...
2
votes
1
answer
273
views
VSCode / Metals / Mill / ScalaTest: AnyFlatSpec specs are not picked up
I am using AnyFlatSpec for my tests:
class FooTest extends AnyFlatSpec with Matchers {
behavior of "The Foo"
it should "do bar" in { ... }
it should "do moo" in { ...