Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit 5933203

Browse files
timonbackstavshamir
authored andcommitted
feat: Add script Update Mocks
Download the current mockData from the amqp and kafka example project
1 parent e1a1d93 commit 5933203

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"build": "ng build --prod --base-href=./",
88
"test": "ng test",
99
"lint": "ng lint",
10-
"e2e": "ng e2e"
10+
"e2e": "ng e2e",
11+
"update-mocks": "node ./script/update_mock_data.js"
1112
},
1213
"private": true,
1314
"dependencies": {

script/update_mock_data.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const https = require("https");
2+
const fs = require("fs");
3+
4+
const downloadFile = (url, path) => {
5+
https.get(url, (res) => {
6+
const writeStream = fs.createWriteStream(path);
7+
8+
res.pipe(writeStream);
9+
10+
writeStream.on("finish", () => {
11+
writeStream.close();
12+
console.log("Wrote file to "+path);
13+
});
14+
});
15+
}
16+
17+
downloadFile("https://raw.githubusercontent.com/springwolf/springwolf-core/master/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json", "src/app/shared/mock/mock.springwolf-amqp-example.json")
18+
downloadFile("https://raw.githubusercontent.com/springwolf/springwolf-core/master/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json", "src/app/shared/mock/mock.springwolf-kafka-example.json")

src/app/shared/mock/mock.springwolf-amqp-example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,4 @@
286286
}
287287
}
288288
}
289-
}
289+
}

0 commit comments

Comments
 (0)