static void start(Keys key, String value, StringBuilder b) {
    b.append(key.name()).append(AuditConstants.KEY_VAL_SEPARATOR).append(value);
  }
@Test
  public void testRouterAuditLoggerWithIP() throws Exception {
    Configuration conf = new Configuration();
    RPC.setProtocolEngine(conf, TestRpcBase.TestRpcService.class, ProtobufRpcEngine2.class);

    // Create server side implementation
    MyTestRouterRPCServer serverImpl = new MyTestRouterRPCServer();
    BlockingService service = TestRpcServiceProtos.TestProtobufRpcProto
        .newReflectiveBlockingService(serverImpl);

    // start the IPC server
    Server server = new RPC.Builder(conf)
        .setProtocol(TestRpcBase.TestRpcService.class)
        .setInstance(service).setBindAddress("0.0.0.0")
        .setPort(0).setNumHandlers(5).setVerbose(true).build();

    server.start();

    InetSocketAddress address = NetUtils.getConnectAddress(server);

    // Make a client connection and test the audit log
    TestRpcBase.TestRpcService proxy = null;
    try {
      proxy = RPC.getProxy(TestRpcBase.TestRpcService.class,
          TestRPC.TestProtocol.versionID, address, conf);
      // Start the testcase
      TestProtos.EmptyRequestProto pingRequest =
          TestProtos.EmptyRequestProto.newBuilder().build();
      proxy.ping(null, pingRequest);
    } finally {
      server.stop();
      if (proxy != null) {
        RPC.stopProxy(proxy);
      }
    }
  }