airframe
airframe copied to clipboard
Airframe log issue with MockFactory
trafficstars
Hi,
I tried to use airframe log which is kind of super cool logging but I am encountering an error in scala flat spec tests using Mockfactory.
Error:-
overriding macro method logAt in trait LoggingMethods of type (logLevel: wvlet.log.LogLevel, message: Any)Unit;
method logAt cannot be used here - only term macros can override term macros
val mockProcessDataFlow = mock[ProcessDataFlow]
Unit Test Code:-
class ProcessDataFlowTest extends MasterUnitSpec with MockFactory {
behavior of "ProcessDataFlowTest"
def fixture = new {
val mockProcessDataFlow = mock[ProcessDataFlow]
}
it should "run" in {
(fixture.mockProcessDataFlow.run _).stubs(workFlow, localConfigFile)
}
}
Parent Code:-
trait ProcessDataFlow extends LoggerUtils with IngestionWorkFlowException {
}
My Logger Utils:-
import wvlet.log.{LogSupport, Logger}
import wvlet.log.Logger
trait LoggerUtils extends LogSupport {
Logger.init
}
Thanks Sri
I think this is the same issue with #788. Mock library implementation should not override macro methods. So I think it's better to file an issue to the mock library side.
@kali786516 As long as, MockFactory is generating an invalid code that overwrites macro methods, it looks there is nothing we can do in airframe-log.
Closing as wontfix