scalamock

mocking methods which use ClassTag in scala using scalamock

大憨熊 提交于 2019-12-06 03:34:50
My first question, question , was answered but it uncovered another issue I am having. Here is the scenario. Example code (expanded from previous question) A Model: case class User (first: String, last: String, enabled: Boolean) Component Definition: trait DataProviderComponent { def find[T: ClassTag](id: Int): Try[T] def update[T](data: T): Try[T] } One of the concrete component implementations (updated implementation): class DbProvider extends DataProviderComponent { override def find[T: ClassTag](id: Int): Try[T] = { Try { val gson = new Gson() val testJson = """{"first": "doe", "last":