Netty4 server无法记录或者回放

Open
#427 0 comments 0 reactions 1 assignee View on GitHub

@lucas-myx is already working on this.

Since Mar 20, 2024.

Assessment

This issue has not been assessed yet.

Description

bug :lady_beetle: good first issue :+1:

Steps to reproduce
deps: vertx-web 3.9.4

public class ServerVerticle extends AbstractVerticle {
    @Override
    public void start() {
        Router router = Router.router(vertx);
        router.get("/hello").handler(routingContext -> {
            routingContext.response().end(new JsonObject().put("message", "Hello, World!").encode());
        });
        vertx.createHttpServer()
            .requestHandler(router)
            .listen(9998);
    }

    public static void main(String[] args) {
        Vertx.vertx().deployVerticle(ServerVerticle.class.getName());
    }
}

Environment

Compiler: 1.8
arex-agent-java: 0.4.0

Additional context
简单修复:
删除掉RequestTracingHandler:channelReadComplete
在ResponseTracingHandler#invoke方法中 添加
if (ContextManager.needReplay()) {
MockUtils.replayBody(mocker);
} else if (ContextManager.needRecord()) {
MockUtils.recordMocker(mocker);
}
CaseEventDispatcher.onEvent(CaseEvent.ofExitEvent());

Dominant language
Java
Stars
566
Forks
141
Avg merge
36m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arextest/arex-agent-java

All issues in arextest/arex-agent-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.