Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bed7472
undefined + typo + constructor raus with @PVahldiek
Apr 20, 2022
cc8af10
linter first fixes with @PVahldiek
Apr 20, 2022
fa2de59
preview raw linter with @PVahldiek
Apr 20, 2022
337f013
linter with @PVahldiek
Apr 20, 2022
2dc514c
linter in datasource with @PVahldiek
Apr 20, 2022
7b956e5
linter with @PVahldiek
Apr 20, 2022
2124140
csv interpreter fixed with @PVahdliek
Apr 20, 2022
ffaa2fa
linter with @PVahldiek
Apr 20, 2022
27c74d5
linter + xmlinterpreter with @PVahldiek
Apr 20, 2022
5f8f58b
xmlInterpreter with new function for converting xml to record
Apr 20, 2022
c23f3b0
xml interpreter with @PVahldiek
Apr 20, 2022
40874de
re-changed to json.parse for json.stringify decoding with @MarcoDoell
PVahldiek Apr 20, 2022
df395f6
additional test in stateless with @PVahldiek
Apr 21, 2022
ecd62bb
unterscheidung internal server error und bad request für httpimporter…
Apr 21, 2022
a4e33c0
convertXmlToJson new function with @PVahldiek
Apr 21, 2022
4041b36
unit tests for adapter Endpoint with @PVahldiek
Apr 21, 2022
509ba96
JEST Unit Tests for JsonInterpreter with @Pvahldiek
Apr 21, 2022
d92f434
added csv interpreter jest file with @PVahldiek
Apr 21, 2022
96c269c
test push
Apr 21, 2022
421f341
jest unit test for xmlinterpreter with @MarcoDoell
PVahldiek Apr 21, 2022
e4192e2
jest tests formatted and xmlinterpreter unit tests with @MarcoDoell
PVahldiek Apr 21, 2022
c06d305
CSV Interpreter Unit test with @MarcoDoell
PVahldiek Apr 21, 2022
e750733
linter finished for adapter with @PVahldiek
Apr 22, 2022
7fb3b22
folder structure for tests with @PVahldiek
Apr 22, 2022
48b12e6
firstRowHeader fixed in CSV Format with @PVahldiek
Apr 22, 2022
479e910
line seperator for test in csv interpreter with @PVahldiek
Apr 22, 2022
1ae5194
further tests for xmlinterpreter with @PVahldiek
Apr 22, 2022
e991012
jest Unit Tests for HTTP Importer with @PVahldiek
Apr 22, 2022
2f5e988
further tests for validateParameters in HTTP Importer with @PVahldiek
Apr 22, 2022
00b5d8a
added fast xml parser with @PVahldiek
Apr 22, 2022
e637af4
new xmlparser library + manuelle löschung vom root element with @PVah…
Apr 22, 2022
6129342
unnötige dependencies raus with @PVahldiek
Apr 22, 2022
9f9a2c9
additional test for csv interpreter + validateparameters changed with…
Apr 22, 2022
90446b6
validateParameters in CSV Interpreter angepasst - weitere Tests für I…
Apr 22, 2022
90dbde7
adapted tests for new xml parser with @PVahldiek
Apr 22, 2022
f26b75c
interpreter when there are no parameters present with @PVahldiek
Apr 22, 2022
59683b8
interpreter bug fix with @PVahldiek
Apr 22, 2022
78b4b6d
fixed integration test with "root" element with @MarcoDoell
PVahldiek Apr 22, 2022
607d4ce
Merge branch 'adapter-nodejs-refactoring' of https://github.com/Marco…
PVahldiek Apr 22, 2022
bb275dd
todo raus with @PVahldiek
Apr 24, 2022
50b1973
method descriptions for adapterService with @PVahldiek
Apr 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
529 changes: 305 additions & 224 deletions adapter/integration-test/src/adapter-stateless.test.js

Large diffs are not rendered by default.

96 changes: 53 additions & 43 deletions adapter/integration-test/src/mock.server.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,74 @@
const Koa = require('koa')
const Router = require('koa-router')
const router = new Router()
const Koa = require('koa');
const Router = require('koa-router');
const router = new Router();

const app = new Koa()
const app = new Koa();

const { MOCK_SERVER_PORT } = require('./env')
const { MOCK_SERVER_PORT } = require('./env');

router.get('/', async ctx => {
ctx.type = 'text/plain'
ctx.body = 'ok'
})
router.get('/', async (ctx) => {
ctx.type = 'text/plain';
ctx.body = 'ok';
});

router.get('/not-found', async ctx => {
ctx.type = 'text/plain'
ctx.status = 404
ctx.body = '404 NOT FOUND Error'
})
router.get('/not-found', async (ctx) => {
ctx.type = 'text/plain';
ctx.status = 404;
ctx.body = '404 NOT FOUND Error';
});

router.get('/json', async ctx => {
console.log('GET /json')
ctx.body = { whateverwillbe: 'willbe', quesera: 'sera' }
})
router.get('/json', async (ctx) => {
console.log('GET /json');
ctx.body = { whateverwillbe: 'willbe', quesera: 'sera' };
});

router.get('/json/:id', async ctx => {
console.log('Get /json/' + ctx.params.id)
ctx.body = { id: ctx.params.id }
})
router.get('/json/:id', async (ctx) => {
console.log('Get /json/' + ctx.params.id);
ctx.body = { id: ctx.params.id };
});

router.get('/xml', async ctx => {
console.log('GET /xml')
router.get('/xml', async (ctx) => {
console.log('GET /xml');

ctx.type = 'text/xml'
ctx.type = 'text/xml';
ctx.body =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<root><from>Rick</from><to>Morty</to></root>'
})
'<root><from>Rick</from><to>Morty</to></root>';
});

router.get('/csv', async ctx => {
console.log('GET /CSV')
router.get('/xmlbigger', async (ctx) => {
console.log('GET /xml');

ctx.type = 'text/csv'
ctx.type = 'text/xml';
ctx.body =
'col1,col2,col3\n' +
'val11,val12,val13\n' +
'val21,val22,val23'
})
'<?xml version="1.0" encoding="UTF-8"?>' +
'<root><from>Rick</from><to>Morty</to>' +
'<test><hello>hello</hello><servus>servus</servus></test>' +
'</root>';
});

router.get('/csv', async (ctx) => {
console.log('GET /CSV');

ctx.type = 'text/csv';
ctx.body = 'col1,col2,col3\n' + 'val11,val12,val13\n' + 'val21,val22,val23';
});

app.use(router.routes())
app.use(router.routes());

const server = app.listen(MOCK_SERVER_PORT, () => console.log('Starting mock server on port ' + MOCK_SERVER_PORT))
const server = app.listen(MOCK_SERVER_PORT, () =>
console.log('Starting mock server on port ' + MOCK_SERVER_PORT),
);

process.on('SIGTERM', async () => {
console.info('Mock-Server: SIGTERM signal received.')
console.info('Mock-Server: SIGTERM signal received.');
try {
await server.close()
await server.close();
} catch (e) {
console.error('Could not shutdown server')
console.error(e)
process.exit(-1)
console.error('Could not shutdown server');
console.error(e);
process.exit(-1);
}
})
});

module.exports = server
module.exports = server;
53 changes: 53 additions & 0 deletions adapter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
"cors": "^2.8.5",
"csvtojson": "^2.0.10",
"express": "^4.17.1",
"jackson-js": "^1.1.0",
"fast-xml-parser": "^4.0.7",
"knex": "^1.0.4",
"prisma": "^3.10.0",
"uuid": "^8.3.2",
"xml2js": "^0.4.23"
"uuid": "^8.3.2"
},
"devDependencies": {
"@jvalue/eslint-config-jvalue": "^1.1.0",
Expand Down
Loading