In my case, I would like to assert the middleware what I through, Here is my soulution.

// TestCase or what you like to put in.
public function assertMiddleware($middleware, $request = null, ...$args)
    // To be sure it's implemented handle method.
    if (! method_exists($middleware, 'handle')) {
        throw new BadMethodCallException();

    // Does it need to customize request?
    $request = $request?:new Request();

    // instanced and called from handle.
    $instance = App::make($middleware)->handle($request, function($request) {
            return new JsonResponse($request);
        }, ...$args);

    // Be sure implementing from JsonResponse.
    $this->assertInstanceOf(JsonResponse::class, $instance);

    return $instance;