anchor.diff:  -module(vstreams_tests).
   -include_lib("eunit/include/eunit.hrl").
   
  --define(URL, api_help:get_webmachine_url()).
  --define(STREAMS_URL, ?URL ++ "/streams/").
  --define(VSTREAMS_URL, ?URL ++ "/vstreams/").
  --define(VSDATAPOINTS_URL, ?URL ++ "/data/").
  +-define(WEBMACHINE_URL, api_help:get_webmachine_url()).
  +-define(STREAMS_URL, ?WEBMACHINE_URL ++ "/streams/").
  +-define(VSTREAMS_URL, ?WEBMACHINE_URL ++ "/vstreams/").
  +-define(VSDATAPOINTS_URL, ?WEBMACHINE_URL ++ "/data/").
   -define(TEST_VALUE, "1").
   -define(INDEX, "sensorcloud").
   
  
positive.code: 	post_request(?STREAMS_URL ++ lib_json:to_string(Streamid2) ++ "/data", "application/json", "{	\"value\":\"2\"}"),
  	post_request(?STREAMS_URL ++ lib_json:to_string(Streamid2) ++ "/data", "application/json", "{	\"value\":\"2\"}"),
  	api_help:refresh(),
  	Response3 = post_request(?VSTREAMS_URL, "application/json", "{\"name\" : \"myvstream\", \"description\" : \"test\",
  			 \"streams_involved\" : [\"" ++ lib_json:to_string(Streamid1) ++ "\", \"" ++ lib_json:to_string(Streamid2) ++ "\"], 
  			 \"timestampfrom\" : \"now-1h\", \"function\" : [\"aggregate\", \"mean\", \"1s\"]}"),
  	check_returned_code(Response3, 200),
  	api_help:refresh()
  	
  	.%?assertNotMatch({error, "no match"}, get_index_id(?TEST_NAME)).
  
  
  %% @doc
  
negative.code: %% @end
  -spec post_test() -> ok | {error, term()}.
  post_test() ->
  	{ok, {{_Version, 200, _ReasonPhrase}, _Headers, Body1}} = httpc:request(post, {?WEBMACHINE_URL++"/users", [],"application/json", "{\"username\" : \"vstreamuser\"}"}, [], []),
  	UserId = lib_json:get_field(Body1,"_id"),
  	api_help:refresh(),
  	{ok, {{_Version2, 200, _ReasonPhrase2}, _Headers2, Body2}} = post_request(?STREAMS_URL, "application/json", "{	\"name\" : \"teststream1\",	\"user_id\" : \"" ++ lib_json:to_string(UserId) ++ "\"	}"),
  	Streamid1 = lib_json:get_field(Body2, "_id"),
  	api_help:refresh(),
  	{ok, {{_Version3, 200, _ReasonPhrase3}, _Headers3, Body3}} = post_request(?STREAMS_URL, "application/json", "{	\"name\" : \"teststream2\",	\"user_id\" : \"" ++ lib_json:to_string(UserId) ++ "\"	}"),
  	Streamid2 = lib_json:get_field(Body3, "_id"),
  	api_help:refresh(),
  	post_request(?STREAMS_URL ++ lib_json:to_string(Streamid1) ++ "/data", "application/json", "{	\"value\":\"1\"}"),
  	post_request(?STREAMS_URL ++ lib_json:to_string(Streamid1) ++ "/data", "application/json", "{	\"value\":\"1\"}"),
  