Skip to content

Commit

Permalink
improve default mocking for 404
Browse files Browse the repository at this point in the history
  • Loading branch information
marikaner committed Dec 21, 2023
1 parent d8a140a commit 13417e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ describe('authentication types', () => {
mockAuthCall: { headers: { 'x-tenant': testTenants.subscriber } }
}),
...mockFindDestinationCallsNotFound(destinationName, {
serviceToken: subscriberServiceToken,
mockAuthCall: false
serviceToken: subscriberServiceToken
})
];

Expand All @@ -216,8 +215,7 @@ describe('authentication types', () => {
mockAuthCall: { headers: { 'x-user-token': subscriberUserToken } }
}),
...mockFindDestinationCallsNotFound(destinationName, {
serviceToken: subscriberServiceToken,
mockAuthCall: false
serviceToken: subscriberServiceToken
})
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ describe('Failure cases', () => {
mockServiceToken();

const httpMocks = [
...mockFindDestinationCallsNotFound(destinationName),
...mockFindDestinationCallsNotFound(destinationName, {
mockAuthCall: false
}),
...mockFindDestinationCallsNotFound(destinationName, {
serviceToken: subscriberServiceToken,
mockAuthCall: false
serviceToken: subscriberServiceToken
})
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,7 @@ describe('destination cache', () => {
);

const [httpMock] = mockFindDestinationCallsNotFound('ProviderDest', {
serviceToken: subscriberServiceToken,
mockAuthCall: false
serviceToken: subscriberServiceToken
});

const actual = await getDestination({
Expand Down
1 change: 1 addition & 0 deletions test-resources/test/test-util/destination-service-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export function mockFindDestinationCallsNotFound(
ErrorMessage: 'Configuration with the specified name was not found'
},
responseCode: 404,
mockAuthCall: false,
...options
});
}
Expand Down

0 comments on commit 13417e9

Please sign in to comment.