aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2017-09-12 11:52:41 -0400
committerTommy Carpenter <tommy@research.att.com>2017-09-12 11:55:09 -0400
commitaebd63152eec0fc8eff7b8757330c27a90849f49 (patch)
tree18d49097568630adf3f5735113734513ce550a78 /test
parent3080e069b14f58dcc4609721cad6ea24ee19a6e9 (diff)
Increase unit test coverage
Issue-ID: DCAEGEN2-99 Change-Id: I16840cef4230bc5123421c7b6a975cefe1c4d136 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'test')
-rw-r--r--test/apitest/apitest_SUITE.erl33
1 files changed, 7 insertions, 26 deletions
diff --git a/test/apitest/apitest_SUITE.erl b/test/apitest/apitest_SUITE.erl
index c15dffc..d948330 100644
--- a/test/apitest/apitest_SUITE.erl
+++ b/test/apitest/apitest_SUITE.erl
@@ -21,7 +21,7 @@
-include_lib("common_test/include/ct.hrl").
-include("../../src/application.hrl").
-export([all/0, groups/0, init_per_suite/1, end_per_suite/1]).
--export([server_health_test/1, app_deploy/1, hydrator_deploy/1, app_teardown/1, app_test/1, app_reconfigure/1, test_failures/1, app_botch_flows/1, app_botch_delete/1, app_botch_consul_delete/1, delete_all/1,
+-export([server_health_test/1, app_deploy/1, hydrator_deploy/1, app_teardown/1, app_test/1, app_reconfigure/1, test_failures/1, app_botch_flows/1, app_botch_delete/1, app_botch_consul_delete/1,
hydrator_app_teardown/1, hydrator_test/1,
hydrator_wdeps_deploy/1,
hydrator_wdeps_test/1,
@@ -39,8 +39,7 @@ all() -> [
{group, hydratorapi},
{group, apibotchedflows},
{group, apibotcheddeleted},
- {group, apibotchedconsuldeleted},
- {group, apideleteall}
+ {group, apibotchedconsuldeleted}
].
groups() -> [
{progapi, %prog-flow test
@@ -89,13 +88,6 @@ groups() -> [
app_deploy,
app_botch_consul_delete,
app_teardown
- ]},
- {apideleteall,
- [],
- [
- server_health_test,
- app_deploy,
- delete_all
]}
].
@@ -289,7 +281,11 @@ init_per_suite(_C) ->
]
.
-end_per_suite(_C) ->
+end_per_suite(C) ->
+ %teardown the fake service and make sure it is gone
+ erlang:display("Tearing down fake service"),
+ {200, Srv} = setup_fake_testing_service(C, teardown),
+ true = Srv == "[]",
_ = application:stop(cdapbroker).
server_health_test(C) ->
@@ -763,18 +759,3 @@ test_failures(C) ->
{<<"program_preferences">>, [{[{<<"program_type">>,<<"flows">>}, {<<"program_id">>, <<"WhoFlow">>}, {<<"program_pref">>, ?PLG(whoflowpref, C)}]}]}
]},
{404, _} = httpabs:put(?XER, URL, "application/json", jiffy:encode(Body3)).
-
-delete_all(C) ->
- %test invalid key
- Body1 = jiffy:encode({[{<<"ids">>, [<<"hwtest">>]}]}),
- {400,"State: Bad Request. Return Body: Invalid PUT Body"} = httpabs:post(?XER, ?SC([?PLG(broker_url, C), "/application/delete"]), "application/json", Body1),
- %test invalid: not a list
- Body2 = jiffy:encode({[{<<"appnames">>, <<"hwtest">>}]}),
- {400,"State: Bad Request. Return Body: Invalid PUT Body"} = httpabs:post(?XER, ?SC([?PLG(broker_url, C), "/application/delete"]), "application/json", Body2),
- %test undeploy a real app and also an app that is not deployed
- Body3 = jiffy:encode({[{<<"appnames">>, [<<"hwtest">>, <<"dissapointment">>]}]}),
- {200, "[200,404]"} = httpabs:post(?XER, ?SC([?PLG(broker_url, C), "/application/delete"]), "application/json", Body3),
- %teardown the fake service and make sure it is gone
- {200, Srv} = setup_fake_testing_service(C, teardown),
- true = Srv == "[]".
-