All Questions
1,408
questions
0
votes
0
answers
24
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
48
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
25
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 ...
0
votes
0
answers
47
views
how can I structure a test suite hierarchically
I like ScalaTest, but I'm trying to figure out if I can arrange tests as in the hierarchy below-- where finer-grained tests are dependent upon more coarse-grained tests succeeding-- for the values ...
0
votes
0
answers
23
views
scalatest matchPattern causes an unmatchable warning in Scala 3
I am using Scala 3.4.1 and scalatest 3.2.18. The example code from the documentation is:
case class Name(first: String, middle: String, last: String)
val name = Name("Jane", "Q", &...
0
votes
0
answers
34
views
Junit5 is running all tests if the tag is not matched
I have been fighting with this problem for the last 2 days and I did not manage to find a solution for it.
I'm trying to do a Gradle task to run some integration tests using Tags and ScalaTest.
If my ...
1
vote
1
answer
50
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
59
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 { ...
0
votes
0
answers
79
views
Writing Integration tests for AKKA HTTP end point
I am quite confused on how to write a integration test for a Akka Http end point. In Java its as easy as use Dropwizard rule to launch the API locally and just carry out get or post for the local end ...
0
votes
1
answer
51
views
forAll in ScalaCheck doesn't run the body
This is the code that tests the surface area of a rectangle with random integers for the coordinates and sizes. Only "begin" will be printed and never "inner body". Does anyone ...
0
votes
0
answers
122
views
Maven Logging for Unit Test Dependencies
I don't know what changed, but starting today when I run unit tests, mvn test, the output is terribly cluttered with INFO and DEBUG log4j logging from a certain dependency. How can I configure Maven ...
0
votes
0
answers
173
views
Kubernetes Leader Election Fails with Unit Test
I'm trying out some leader election logic in one of my Microservice using the Kubernetes fabirc java client. Here is what I came up with:
def testAndAssertSingleLeader(client: KubernetesClient, id: ...
0
votes
1
answer
57
views
Scala Issue with Mixin Traits and Conflicting Members
I have the following setup for ms Scala test where I have a trait that looks like this:
trait CPODBTestContainerSpec extends AnyFlatSpecLike with TestContainerForAll {
....
....
}
abstract class ...
1
vote
1
answer
242
views
Parametrized testing in scala with MUnit, is it possible?
I am trying to figure out if I can create parametrized tests with MUnit or ScalaCheck.
ScalaCheck allows me to create property-based tests. However, the only way I have seen that I can create ...
0
votes
0
answers
35
views
Scala: Package test from multiple sub projects
There is a very large Scala project with many sub projects, assume there are 4 sub projects only: project-a, project-b, project-c, project-d.
Project structure is standard, something like:
$ tree ...