@@ -32,7 +32,7 @@ import {
3232 jwtBearerToken ,
3333 serviceToken ,
3434 getIasToken ,
35- getIasDestination
35+ createDestinationFromIasService
3636} from './token-accessor' ;
3737import { clearXsuaaServices } from './environment-accessor' ;
3838import type { Service } from './environment-accessor' ;
@@ -595,7 +595,9 @@ describe('getIasToken()', () => {
595595
596596 describe ( 'resource parameter' , ( ) => {
597597 it ( 'passes resource (by name) to fetchIasToken' , async ( ) => {
598- await getIasToken ( mockService , { resource : { name : 'my-app' } } ) ;
598+ await getIasToken ( mockService , {
599+ resource : { name : 'my-app' }
600+ } ) ;
599601
600602 expect ( mockFetchIasToken ) . toHaveBeenCalledWith (
601603 expect . anything ( ) ,
@@ -644,7 +646,7 @@ describe('getIasToken()', () => {
644646 } ) ;
645647} ) ;
646648
647- describe ( 'getIasDestination ()' , ( ) => {
649+ describe ( 'createDestinationFromIasService ()' , ( ) => {
648650 const identityServiceMock = jest . requireMock ( './identity-service' ) ;
649651 let mockFetchIasToken : jest . Mock ;
650652 let mockGetIasAppTid : jest . Mock ;
@@ -689,7 +691,7 @@ describe('getIasDestination()', () => {
689691 } ) ;
690692
691693 it ( 'returns an HttpDestination with token and service URL' , async ( ) => {
692- const destination = await getIasDestination ( mockCredentials ) ;
694+ const destination = await createDestinationFromIasService ( mockCredentials ) ;
693695
694696 expect ( destination ) . toEqual (
695697 expect . objectContaining ( {
@@ -707,7 +709,7 @@ describe('getIasDestination()', () => {
707709 } ) ;
708710
709711 it ( 'includes mTLS key pair when certificate and key are present' , async ( ) => {
710- const destination = await getIasDestination ( mockCredentials ) ;
712+ const destination = await createDestinationFromIasService ( mockCredentials ) ;
711713
712714 expect ( destination . mtlsKeyPair ) . toEqual ( {
713715 cert : '-----BEGIN CERTIFICATE-----\ntest\n-----END CERTIFICATE-----' ,
@@ -718,13 +720,13 @@ describe('getIasDestination()', () => {
718720 it ( 'does not include mTLS key pair when certificate/key are absent' , async ( ) => {
719721 const { certificate : _c , key : _k , ...credsWithoutCert } = mockCredentials ;
720722
721- const destination = await getIasDestination ( credsWithoutCert ) ;
723+ const destination = await createDestinationFromIasService ( credsWithoutCert ) ;
722724
723725 expect ( destination . mtlsKeyPair ) . toBeUndefined ( ) ;
724726 } ) ;
725727
726728 it ( 'uses targetUrl when provided' , async ( ) => {
727- const destination = await getIasDestination ( mockCredentials , {
729+ const destination = await createDestinationFromIasService ( mockCredentials , {
728730 targetUrl : 'https://custom-target.example.com'
729731 } ) ;
730732
@@ -734,7 +736,7 @@ describe('getIasDestination()', () => {
734736 it ( 'uses OAuth2JWTBearer authentication type when specified' , async ( ) => {
735737 const assertion = signedJwt ( { user_uuid : 'user-1' , app_tid : 'tid' } ) ;
736738
737- const destination = await getIasDestination ( mockCredentials , {
739+ const destination = await createDestinationFromIasService ( mockCredentials , {
738740 authenticationType : 'OAuth2JWTBearer' ,
739741 assertion
740742 } ) ;
@@ -743,7 +745,7 @@ describe('getIasDestination()', () => {
743745 } ) ;
744746
745747 it ( 'delegates to getIasToken with the provided options' , async ( ) => {
746- await getIasDestination ( mockCredentials , {
748+ await createDestinationFromIasService ( mockCredentials , {
747749 useCache : false ,
748750 jwt : { app_tid : 'tenant-123' }
749751 } ) ;
0 commit comments