mockito-scala icon indicating copy to clipboard operation
mockito-scala copied to clipboard

Mockito for Scala language

Results 40 mockito-scala issues
Sort by recently updated
recently updated
newest added

Scala 3 has a ton of changes on the internals and more importantly, the macros. mockito-scala makes heavy use of macros, reflection and it also relies on knowing how certain...

Using Mockito I do not receive the error but when using mockito-scala I do. Code below mirrors the code I'm writing. scalaVersion: 2.12.16 mockito-scala: 1.17.7 ```scala package org.ljr import org.mockito.AdditionalAnswers._...

Basically exactly the same behaviour as in: https://github.com/mockito/mockito/issues/2082 I'm using mock-maker-inline.

I'm using java 8 and scala 2.12. Is `withObjectMocked` supported in Java 8? ``` [info] java.lang.NoSuchFieldException: modifiers [info] at java.base/java.lang.Class.getDeclaredField(Class.java:2412) [info] at org.mockito.ReflectionUtils$.setFinalStatic(ReflectionUtils.scala:128) [info] at org.mockito.MockitoEnhancer.withObjectMocked(MockitoAPI.scala:641) [info] at org.mockito.MockitoEnhancer.withObjectMocked$(MockitoAPI.scala:630) ```

I've provided a very simple sbt project that reproduces this problem. [by-name-repro.zip](https://github.com/mockito/mockito-scala/files/8529596/by-name-repro.zip) In the reproduction project, similar to my actual scenario but simplified, the scenario is as follows: I have...

I have a test suite that overrides the executionContext, replacing serialExecutionContext with the scala default global executionContext. This leads to transient errors because of `MockitoSessionAsyncFixture.withFixture`. This function calls `session.finishMocking` inside...

- [x] The mockito message in the stacktrace have useful information, but it didn't help - [x] The problematic code (if that's possible) is copied here; Note that some configuration...

Hi Team, I have written this test but I am facing issue. test("applyNewDeviceEnrolledChanges") { val dao: DataAccessLayerDAO = mock(classOf[DataAccessLayerDAO]) val metricStartTimeStamp : Timestamp = new Timestamp(LocalDate.parse("2021-10-03").atStartOfDay(ZoneId.of("UTC")).toInstant.toEpochMilli) val metricEndTimeStamp : Timestamp...

Are there any plans to add integration support for [munit][1] (scala) -- similar to how integration for scalatest and specs2? [1]: https://github.com/scalameta/munit

I'm not sure if it's limited to AnyVals or applies to any class with a private constructor, but it seems to be impossible to match arguments of such type. Pseudo-example:...