test(manager-api): test API tags feature
MODIFY
manager/api/beans/src/main/java/io/apiman/manager/api/beans/apis/ApiBean.java
manager/api/beans/src/main/java/io/apiman/manager/api/beans/apis/ApiBean.java
@@ -71,7 +71,7 @@ public class ApiBean implements Serializable, Cloneable {
private String image;
@Column(name = "description", updatable=true, nullable=true, length=512)
private String description;
- @ManyToMany(cascade = CascadeType.ALL)
+ @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "api_tag",
joinColumns = { @JoinColumn(name = "api_id"), @JoinColumn(name = "org_id") },
inverseJoinColumns = @JoinColumn(name = "tag_id")

ADD
manager/test/api/src/test/resources/test-plan-data/apis/apis/013_tag-api.resttest
+PUT /organizations/Organization1/apis/API1/tags admin/admin
+Content-Type: application/json
+
+{
+ "key": "featured",
+ "value": "cool"
+}
+----
+204
+

ADD
manager/test/api/src/test/resources/test-plan-data/apis/apis/014_get-api1-assert-tags.resttest
+GET /organizations/Organization1/apis/API1 admin/admin
+----
+200
+Content-Type: application/json
+
+{
+ "organization" : {
+ "id" : "Organization1"
+ },
+ "id" : "API1",
+ "name" : "API 1",
+ "description" : "[UPDATED] This is the description of API 1!",
+ "createdBy" : "admin",
+ "tags": [{
+ "key": "featured",
+ "value": "cool"
+ }]
+}

MODIFY
manager/test/api/src/test/resources/test-plans/apis-testPlan.xml
manager/test/api/src/test/resources/test-plans/apis-testPlan.xml
<test name="List APIs">test-plan-data/apis/apis/011_list-apis.resttest</test>
<test name="Get API 1 [3]-">test-plan-data/apis/apis/009_get-api1.resttest</test>
<test name="Create API (invalid name)">test-plan-data/apis/apis/012_create-invalid-name.resttest</test>
+
+ <test name="Tag API">test-plan-data/apis/apis/013_tag-api.resttest</test>
+ <test name="GET API 1 (Verify Tags)">test-plan-data/apis/apis/014_get-api1-assert-tags.resttest</test>
</testGroup>
<!-- Test API Version management -->

test(manager-api): test API tags feature