Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Max Gruenfelder committed Aug 28, 2024
2 parents efaa300 + 631e9b4 commit 1b352fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## v1.6.6 - 2024-08-XX
## v1.6.6 - 2024-08-28

### Fixed

- In some cases the event broadcasting is delayed if a periodic event can't obtain the processing lock

## v1.6.5 - 2024-08-22
## v1.6.5 - 2024-08-23

### Added

- Introduced the `retryFailedAfter` configuration option, allowing you to specify the interval (in milliseconds) after which failed events should be retried, provided the retry limit has not been exceeded.
- Increased test coverage for fetching authInfo with @sap/xssec

## v1.6.4 - 2024-08-14

Expand Down
14 changes: 14 additions & 0 deletions test/common.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ describe("getAuthInfo", () => {
expect(cds.log().warn.mock.calls).toHaveLength(0);
});

it("should correctly pass tenant id to xssec", async () => {
const fetchClientCredentialsTokenSpy = jest
.spyOn(xssec.XsuaaService.prototype, "fetchClientCredentialsToken")
.mockResolvedValueOnce({ access_token: "token" });
jest.spyOn(xssec.XsuaaService.prototype, "createSecurityContext").mockResolvedValueOnce({
getExpirationDate: () => new Date(),
});
const result = await getAuthInfo("1");
expect(result).toBeDefined();
expect(fetchClientCredentialsTokenSpy).toHaveBeenCalledWith({ zid: "1" });
expect(cds.log().warn.mock.calls).toHaveLength(0);
fetchClientCredentialsTokenSpy;
});

it("should use cache for the second call", async () => {
jest
.spyOn(xssec.XsuaaService.prototype, "fetchClientCredentialsToken")
Expand Down

0 comments on commit 1b352fc

Please sign in to comment.