private String getUserAgentIfAvailable() {
        final AttributeKey<String> userAgentAttrKey = AttributeKey.valueOf(UserAgent.USER_AGENT_HEADER_NAME);
        if(!(server.getChannelizer() instanceof TestChannelizer)) {
            return null;
        }
        final TestChannelizer channelizer = (TestChannelizer) server.getChannelizer();
        final ChannelHandlerContext ctx = channelizer.getMostRecentChannelHandlerContext();
        if(ctx == null || !ctx.channel().hasAttr(userAgentAttrKey)) {
            return null;
        }
        return channelizer.getMostRecentChannelHandlerContext().channel().attr(userAgentAttrKey).get();
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java