Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 5c396b7

Browse files
author
Chris Wiechmann
committed
Integration tests fixed
1 parent 10c0bc5 commit 5c396b7

File tree

16 files changed

+18
-15
lines changed

16 files changed

+18
-15
lines changed

.github/workflows/apibuilder4elastic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
ELASTICSEARCH_HOSTS: 'http://localhost:9200'
135135
VALIDATE_CONFIG: false
136136
LOG_LEVEL: DEBUG
137-
DISABLE_SETUP_FLOWS: true # Disable Elasticsearch tests for the tests.
137+
DISABLE_SETUP_FLOWS: true # Disable Elasticsearch setup flows for the tests.
138138
CI: true
139139
run: |
140140
npm ci

apibuilder4elastic/custom_flow_nodes/api-builder-plugin-axway-api-management/src/actions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ async function lookupTopology(params, options) {
142142
cache.set( cacheKey, topology, 300);
143143
return topology;
144144
}
145+
// Without topology, inactive serviceIDs will not be included in the Traffic-Monitor result set
146+
logger.error(`Error retrieving topology from ANM. With that EMT-Mode is not fully supported.`);
147+
return {};
145148
}
146149

147150
async function lookupAPIDetails(params, options) {

apibuilder4elastic/test/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ API_MANAGER_USERNAME=apiadmin
66
API_MANAGER_PASSWORD=changeme
77

88
# Dont validate API-Manager configuration when running tests, which are mocked anyway
9-
VALIDATE_CONFIG=false
9+
VALIDATE_CONFIG=true
1010

1111
# Let the HTTP Port enbaled when running tests
1212
ENABLE_HTTP_PORT=true

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/filetransfer/test_search_filetransfer_AsAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Endpoints', function () {
1616
// Simulate all responses in this test-file to be an admin, which will not lead to any result restriction
1717
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
1818
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
19-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
19+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
2020
});
2121

2222
afterEach(() => {

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/http/test_search_count_AsAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Endpoints', function () {
1515
// Simulate all responses in this test-file to be an admin, which will not lead to any result restriction
1616
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
1717
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
18-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
18+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
1919
});
2020

2121
afterEach(() => {

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/http/test_search_endpoint_AsAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Endpoints', function () {
1616
// Simulate all responses in this test-file to be an admin, which will not lead to any result restriction
1717
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
1818
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
19-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
19+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
2020
});
2121

2222
afterEach(() => {

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/http/test_search_endpoint_AsAdmin_with_EMT.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Endpoints', function () {
6767
expect(response.statusCode).to.equal(200);
6868
expect(body).to.be.an('Object');
6969
expect(body).to.have.property('data');
70-
debugger;
70+
7171
expect(body.data).to.have.lengthOf(2); // Expected two results - One for the given Service-ID and the one already GONE
7272
expect(body.data[0].correlationId).to.equals('7a240f5f0e21555d2d343482');
7373
expect(body.data[1].correlationId).to.equals('19250f5f4321b5ba2a4de364');

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/http/test_search_endpoint_regional.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Endpoints', function () {
1818
// Simulate all responses in this test-file to be an admin, which will not lead to any result restriction
1919
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
2020
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
21-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
21+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
2222
});
2323

2424
afterEach(() => {

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/jms/test_search_jms_AsAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Endpoints', function () {
1919
// Which is translated into false by the Policy and the ANM implementation then takes care of the request
2020
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
2121
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
22-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
22+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
2323
});
2424

2525
afterEach(() => {

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/websock/test_search_websock_AsAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Endpoints', function () {
1919
// Which is translated into false by the Policy --> The ANM implementation then takes care of the request
2020
nock('https://mocked-api-gateway:8090').get('/api/rbac/currentuser').reply(200, { "result": "david" });
2121
nock('https://mocked-api-gateway:8090').get('/api/rbac/permissions/currentuser').replyWithFile(200, './test/mockedReplies/apigateway/adminUserDavid.json');
22-
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { });
22+
nock('https://mocked-api-gateway:8090').get('/api/topology').reply(200, { result: {} });
2323
});
2424

2525
afterEach(() => {

0 commit comments

Comments
 (0)