Skip to content

Commit 9a062e3

Browse files
committed
Changing literals to - endpointDeclaration.functionName
1 parent b17d249 commit 9a062e3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test-basic/endpoint-caller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Endpoint caller', function() {
2525
it('moduleInitSjs endpoint', function(done) {
2626
const serviceDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/moduleInitSjs/service.json', {encoding: 'utf8'}));
2727
const endpointDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/moduleInitSjs/initializer.api', {encoding: 'utf8'}));
28-
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+'initializer'+'.sjs';
28+
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+endpointDeclaration.functionName+'.sjs';
2929
const endpointCaller = dbWriter.endpointCaller(endpointDeclaration);
3030
const params = {param1:true, param2: '1.2', param3: [1.2, 3.4], param4:[5, 6] };
3131

@@ -43,7 +43,7 @@ describe('Endpoint caller', function() {
4343
it('moduleInitXqy endpoint', function(done) {
4444
const serviceDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/moduleInitXqy/service.json', {encoding: 'utf8'}));
4545
const endpointDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/moduleInitXqy/initializer.api', {encoding: 'utf8'}));
46-
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+'initializer'+'.xqy';
46+
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+endpointDeclaration.functionName+'.xqy';
4747
const endpointCaller = dbWriter.endpointCaller(endpointDeclaration);
4848
const params = {param1:true, param2: '1.2', param3: [1.2, 3.4], param4:[5, 6] };
4949

@@ -63,7 +63,7 @@ describe('Endpoint caller', function() {
6363
{encoding: 'utf8'}));
6464
const endpointDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/postOfMultipartForDocument/postOfMultipartForDocumentArray1.api',
6565
{encoding: 'utf8'}));
66-
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+'postOfMultipartForDocumentArray1'+'.sjs';
66+
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+endpointDeclaration.functionName+'.sjs';
6767
const endpointCaller = dbWriter.endpointCaller(endpointDeclaration);
6868
const params = {param1:[{"root":{"child":"text1"}}, {"root":{"child":"text2"}}]};
6969

@@ -83,7 +83,7 @@ describe('Endpoint caller', function() {
8383
{encoding: 'utf8'}));
8484
const endpointDeclaration = JSON.parse(fs.readFileSync('test-basic-proxy/ml-modules/generated/postOfUrlencodedForDocument/postOfUrlencodedForDocumentArray1.api',
8585
{encoding: 'utf8'}));
86-
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+'postOfUrlencodedForDocumentArray1'+'.mjs';
86+
endpointDeclaration.endpoint = serviceDeclaration.endpointDirectory+endpointDeclaration.functionName+'.mjs';
8787
const endpointCaller = dbWriter.endpointCaller(endpointDeclaration);
8888
const params = {param1:[1.2, 3.4]};
8989

test-basic/service-caller.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('Service caller', function() {
2929
const serviceCaller = dbWriter.serviceCaller(serviceDeclaration, [endpointDeclaration]);
3030
const params = {param1:true, param2: '1.2', param3: [1.2, 3.4], param4:[5, 6] };
3131

32-
serviceCaller.call('initializer', params)
32+
serviceCaller.call(endpointDeclaration.functionName, params)
3333
.then(output => {
3434
expect(output).to.eql(true);
3535
done();
@@ -47,7 +47,7 @@ describe('Service caller', function() {
4747
const serviceCaller = dbWriter.serviceCaller(serviceDeclaration, [endpointDeclaration]);
4848
const params = {param1:true, param2: '1.2', param3: [1.2, 3.4], param4:[5, 6] };
4949

50-
serviceCaller.call('initializer', params)
50+
serviceCaller.call(endpointDeclaration.functionName, params)
5151
.then(output => {
5252
expect(output).to.eql(true);
5353
done();
@@ -67,7 +67,7 @@ describe('Service caller', function() {
6767
const serviceCaller = dbWriter.serviceCaller(serviceDeclaration, [endpointDeclaration]);
6868
const params = {param1:[{"root":{"child":"text1"}}, {"root":{"child":"text2"}}]};
6969

70-
serviceCaller.call('postOfMultipartForDocumentArray1', params)
70+
serviceCaller.call(endpointDeclaration.functionName, params)
7171
.then(output => {
7272
expect(output).to.eql(["text1", 1]);
7373
done();
@@ -87,7 +87,7 @@ describe('Service caller', function() {
8787
const serviceCaller = dbWriter.serviceCaller(serviceDeclaration, [endpointDeclaration]);
8888
const params = {param1:[1.2, 3.4]};
8989

90-
serviceCaller.call('postOfUrlencodedForDocumentArray1', params)
90+
serviceCaller.call(endpointDeclaration.functionName, params)
9191
.then(output => {
9292
expect(output).to.eql(["text1", 1]);
9393
done();
@@ -110,10 +110,10 @@ describe('Service caller', function() {
110110
const params1 = {param1:[1.2, 3.4]};
111111
const params2 = {param1:[{"root":{"child":"text1"}}, {"root":{"child":"text2"}}]};
112112

113-
serviceCaller.call('postOfMultipartForDocumentArray1', params1)
113+
serviceCaller.call(endpointDeclaration1.functionName, params1)
114114
.then(output => {
115115
expect(output).to.eql(["text1", 1]);
116-
return serviceCaller.call('postOfMultipartForDocumentTextDocument1', params2);
116+
return serviceCaller.call(endpointDeclaration2.functionName, params2);
117117
})
118118
.then(output => {
119119
expect(output).to.eql('abc');

0 commit comments

Comments
 (0)