Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
applications can now be re-registered (users can add/remove contracts…
… and then re-synch/re-register the app with the gateway(s))
- Loading branch information
1 parent
e586914
commit 17b74a2
Showing
33 changed files
with
349 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
gateway/engine/core/src/main/resources/io/apiman/gateway/engine/i18n/messages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
gateway/engine/es/src/main/resources/io/apiman/gateway/engine/es/i18n/messages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
gateway/test/src/test/java/io/apiman/gateway/test/AppReregisterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2014 JBoss Inc | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.apiman.gateway.test; | ||
|
||
import io.apiman.gateway.test.junit.GatewayRestTestPlan; | ||
import io.apiman.gateway.test.junit.GatewayRestTester; | ||
|
||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Make sure that at App can be re-registered. | ||
* | ||
* @author eric.wittmann@redhat.com | ||
*/ | ||
@RunWith(GatewayRestTester.class) | ||
@GatewayRestTestPlan("test-plans/app-reregister/app-reregister-testPlan.xml") | ||
public class AppReregisterTest { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
gateway/test/src/test/resources/test-plan-data/app-reregister/echo/001-service-1.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GET /AppReregisterTest/echo-1/1.0/path/to/app/resource admin/admin | ||
X-API-Key: service-1 | ||
Accept: application/json | ||
|
||
---- | ||
200 | ||
Content-Type: application/json | ||
|
||
{ | ||
"method" : "GET", | ||
"resource" : "/echo-1/path/to/app/resource", | ||
"uri" : "/echo-1/path/to/app/resource" | ||
} |
13 changes: 13 additions & 0 deletions
13
gateway/test/src/test/resources/test-plan-data/app-reregister/echo/002-service-2.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GET /AppReregisterTest/echo-2/1.0/path/to/app/resource admin/admin | ||
X-API-Key: service-2 | ||
Accept: application/json | ||
|
||
---- | ||
200 | ||
Content-Type: application/json | ||
|
||
{ | ||
"method" : "GET", | ||
"resource" : "/echo-2/path/to/app/resource", | ||
"uri" : "/echo-2/path/to/app/resource" | ||
} |
13 changes: 13 additions & 0 deletions
13
...est/src/test/resources/test-plan-data/app-reregister/setup/001-publish-service-1.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PUT /services admin/admin | ||
Content-Type: application/json | ||
|
||
{ | ||
"organizationId" : "AppReregisterTest", | ||
"serviceId" : "echo-1", | ||
"version" : "1.0", | ||
"endpointType" : "rest", | ||
"endpointContentType" : "json", | ||
"endpoint" : "${apiman-gateway-test.endpoints.echo}/echo-1" | ||
} | ||
---- | ||
204 |
13 changes: 13 additions & 0 deletions
13
...est/src/test/resources/test-plan-data/app-reregister/setup/002-publish-service-2.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PUT /services admin/admin | ||
Content-Type: application/json | ||
|
||
{ | ||
"organizationId" : "AppReregisterTest", | ||
"serviceId" : "echo-2", | ||
"version" : "1.0", | ||
"endpointType" : "rest", | ||
"endpointContentType" : "json", | ||
"endpoint" : "${apiman-gateway-test.endpoints.echo}/echo-2" | ||
} | ||
---- | ||
204 |
18 changes: 18 additions & 0 deletions
18
...way/test/src/test/resources/test-plan-data/app-reregister/setup/003-register-app.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
PUT /applications admin/admin | ||
Content-Type: application/json | ||
|
||
{ | ||
"organizationId" : "AppReregisterTest", | ||
"applicationId" : "test", | ||
"version" : "1.0", | ||
"contracts" : [ | ||
{ | ||
"apiKey" : "service-1", | ||
"serviceOrgId" : "AppReregisterTest", | ||
"serviceId" : "echo-1", | ||
"serviceVersion" : "1.0" | ||
} | ||
] | ||
} | ||
---- | ||
204 |
24 changes: 24 additions & 0 deletions
24
...y/test/src/test/resources/test-plan-data/app-reregister/setup/004-reregister-app.resttest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
PUT /applications admin/admin | ||
Content-Type: application/json | ||
|
||
{ | ||
"organizationId" : "AppReregisterTest", | ||
"applicationId" : "test", | ||
"version" : "1.0", | ||
"contracts" : [ | ||
{ | ||
"apiKey" : "service-1", | ||
"serviceOrgId" : "AppReregisterTest", | ||
"serviceId" : "echo-1", | ||
"serviceVersion" : "1.0" | ||
}, | ||
{ | ||
"apiKey" : "service-2", | ||
"serviceOrgId" : "AppReregisterTest", | ||
"serviceId" : "echo-2", | ||
"serviceVersion" : "1.0" | ||
} | ||
] | ||
} | ||
---- | ||
204 |
19 changes: 19 additions & 0 deletions
19
gateway/test/src/test/resources/test-plans/app-reregister/app-reregister-testPlan.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testPlan xmlns="urn:io.apiman.test:2014:02:testPlan"> | ||
|
||
<testGroup name="Publish the Services" endpoint="api"> | ||
<test name="Publish Service 1">test-plan-data/app-reregister/setup/001-publish-service-1.resttest</test> | ||
<test name="Publish Service 2">test-plan-data/app-reregister/setup/002-publish-service-2.resttest</test> | ||
</testGroup> | ||
|
||
<testGroup name="Register the App" endpoint="api"> | ||
<test name="Register Application">test-plan-data/app-reregister/setup/003-register-app.resttest</test> | ||
<test name="Update Application">test-plan-data/app-reregister/setup/004-reregister-app.resttest</test> | ||
</testGroup> | ||
|
||
<testGroup name="Test the updated App"> | ||
<test name="Echo Service 1 (GET)">test-plan-data/app-reregister/echo/001-service-1.resttest</test> | ||
<test name="Echo Service 2 (GET)">test-plan-data/app-reregister/echo/002-service-2.resttest</test> | ||
</testGroup> | ||
|
||
</testPlan> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.