anchor.diff:           {"Create app token",
               fun() ->
                   Ret = http:request(post, 
  -                    {"http://localhost:8002/channels/" ++ get(channel_id) ++ "/token", headers(), content_type(), iolist_to_binary(mochijson2:encode({struct, [
  +                    {"http://localhost:" ++ Port ++ "/channels/" ++ get(channel_id) ++ "/token", headers(), content_type(), iolist_to_binary(mochijson2:encode({struct, [
                           {"channel_id", list_to_binary(get(channel_id))},
                           {"name", <<"app">>}
                       ]}))}, [], []),
  
positive.code:             end},
           {"Verify ps filter",
              fun() ->
                  Ret = http:request(get, {"http://localhost:8002" ++ get(session), headers()}, [], []),
                  ?assertMatch({ok,{{_,200,_},_,_}}, Ret),
                  {ok,{{_,200,_},_,Logs}} = Ret,
                  Logs1 = string:tokens(Logs, "\n"),
  
negative.code:             end},
           {"Delete drain",
              ?_assertMatch({ok,{{_,200,_},_,_}},
                  http:request(delete, {"http://localhost:" ++ Port ++ "/channels/" ++ get(channel_id) ++ "/drains?host=10.0.0.1&port=514", headers()}, [], []))},
           {"Delete non-existent drain",
              ?_assertMatch({ok,{{_,404,_},_,"Not found"}},
                  http:request(delete, {"http://localhost:" ++ Port ++ "/channels/" ++ get(channel_id) ++ "/drains?host=10.0.0.1&port=514", headers()}, [], []))},
           {"Delete channel",
              ?_assertMatch({ok,{{_,200,_},_,_}},
                  http:request(delete, {"http://localhost:" ++ Port ++ "/channels/" ++ get(channel_id), headers()}, [], []))},
           {"Delete non-existent channel",
              ?_assertMatch({ok,{{_,404,_},_,"Not found"}},
                 http:request(delete, {"http://localhost:" ++ Port ++ "/channels/" ++ get(channel_id), headers()}, [], []))},
           {"Verify healthcheck 'Zero child processes running'",
              fun() ->
                  [logplex_queue:stop(Pid) || {_,Pid,_,_} <- supervisor:which_children(logplex_read_queue_sup)],
                  ?assertMatch({ok,{{_,500,_},_,"Zero logplex_read_queue_sup child processes running"}}, http:request(get, {"http://localhost:" ++ Port ++ "/healthcheck", headers()}, [], []))
              end}
          ]
      }.
  