Hi I am trying to test this functionality within the controller, I need to mock "MyActor" for doing the unit test.
def populateArraylist[T](hashSet: HashSet[T]): util.ArrayList[T] = {
val list = new util.ArrayList[T]()
hashSet.foreach(x => list.add(x))
list
}
@ApiOperation("Get the state of a something”)
def get(ID: String, dateID: String): Action[AnyContent] = Action.async
{
implicit request =>
(MyShardProvider.shard ? MyActor.EntityPayload(
Id,
MySecondActor.GetStateRequest(dateId)))
.mapTo[GetStateResponse]
.map(x => {
Ok(new String(JacksonSerializer.toBytes(new GetResponse(
x.state.identifier,
populateArraylist(x.data.transactionList.processedKeys)
))))
})
}