@@ -240,21 +240,7 @@ public async Task GetAllProvidedConnectorsDataWithCheckTypeConnectorAsService_Wi
240240 }
241241 #endregion
242242
243- #region Create Connector
244-
245- [ Fact ]
246- public async Task CreateConnectorAsync_WithoutTechnicalUser_ThrowsException ( )
247- {
248- // Arrange
249- var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , null ) ;
250-
251- // Act
252- async Task Act ( ) => await _logic . CreateConnectorAsync ( connectorInput , CancellationToken . None ) ;
253-
254- // Assert
255- var ex = await Assert . ThrowsAsync < ControllerArgumentException > ( Act ) ;
256- ex . Message . Should ( ) . Be ( AdministrationConnectorErrors . CONNECTOR_MISSING_TECH_USER . ToString ( ) ) ;
257- }
243+ #region Create Connector
258244
259245 [ Theory ]
260246 [ InlineData ( true ) ]
@@ -372,10 +358,8 @@ public async Task CreateConnectorAsync_WithLinkedTechnicalUser_ThrowsControllerA
372358 public async Task CreateConnectorAsync_WithClientIdNull_DoesntSaveData ( )
373359 {
374360 // Arrange
375- var sa01 = Guid . NewGuid ( ) ;
376- var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , sa01 ) ;
361+ var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , null ) ;
377362
378- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
379363 // Act
380364 var result = await _logic . CreateConnectorAsync ( connectorInput , CancellationToken . None ) ;
381365
@@ -388,7 +372,6 @@ public async Task CreateConnectorAsync_WithClientIdNull_DoesntSaveData()
388372 public async Task CreateConnectorAsync_WithoutSelfDescriptionDocumentAndSdConnectionDisabled_CallsExpected ( )
389373 {
390374 // Arrange
391- var sa01 = Guid . NewGuid ( ) ;
392375 var sut = new ConnectorsBusinessLogic ( _portalRepositories , Options . Create ( new ConnectorsSettings
393376 {
394377 MaxPageSize = 15 ,
@@ -414,9 +397,8 @@ public async Task CreateConnectorAsync_WithoutSelfDescriptionDocumentAndSdConnec
414397 ]
415398 } ) , _sdFactoryBusinessLogic , _identityService , _serviceAccountManagement , _dateTimeProvider , A . Fake < ILogger < ConnectorsBusinessLogic > > ( ) ) ;
416399
417- var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , sa01 ) ;
400+ var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , null ) ;
418401 A . CallTo ( ( ) => _identity . CompanyId ) . Returns ( CompanyIdWithoutSdDocument ) ;
419- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
420402
421403 // Act
422404 await sut . CreateConnectorAsync ( connectorInput , CancellationToken . None ) ;
@@ -430,10 +412,9 @@ public async Task CreateConnectorAsync_WithoutSelfDescriptionDocumentAndSdConnec
430412 public async Task CreateConnectorAsync_WithoutSelfDescriptionDocument_ThrowsUnexpectedException ( )
431413 {
432414 // Arrange
433- var sa01 = Guid . NewGuid ( ) ;
434- var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , sa01 ) ;
415+ var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , null ) ;
435416 A . CallTo ( ( ) => _identity . CompanyId ) . Returns ( CompanyIdWithoutSdDocument ) ;
436- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
417+
437418 // Act
438419 async Task Act ( ) => await _logic . CreateConnectorAsync ( connectorInput , CancellationToken . None ) ;
439420
@@ -475,9 +456,7 @@ public async Task CreateConnectorAsync_WithCompanyWithoutBpn_ThrowsUnexpectedCon
475456 public async Task CreateConnectorAsync_WithFailingDapsService_ReturnsCreatedConnectorData ( )
476457 {
477458 // Arrange
478- var sa01 = Guid . NewGuid ( ) ;
479- var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , sa01 ) ;
480- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
459+ var connectorInput = new ConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , null ) ;
481460
482461 // Act
483462 var result = await _logic . CreateConnectorAsync ( connectorInput , CancellationToken . None ) ;
@@ -541,13 +520,12 @@ public async Task CreateManagedConnectorAsync_WithValidInput_ReturnsCreatedConne
541520 }
542521
543522 [ Theory ]
544- [ InlineData ( true , "ac1cf001-7fbc-1f2f-817f-bce058020002" ) ] // Valid technical user
545- [ InlineData ( false , null ) ]
546- public async Task CreateManagedConnectorAsync_WithTechnicalUser_ReturnsCreatedConnectorData ( bool clearingHouseDisabled , string ? technicalUserIdString )
523+ [ InlineData ( true ) ]
524+ [ InlineData ( false ) ]
525+ public async Task CreateManagedConnectorAsync_WithTechnicalUser_ReturnsCreatedConnectorData ( bool clearingHouseDisabled )
547526 {
548527 // Arrange
549- Guid ? technicalUserId = technicalUserIdString != null ? Guid . Parse ( technicalUserIdString ) : null ;
550- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , _validOfferSubscriptionId , technicalUserId ) ;
528+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , _validOfferSubscriptionId , null ) ;
551529 var sut = new ConnectorsBusinessLogic ( _portalRepositories , Options . Create ( new ConnectorsSettings
552530 {
553531 MaxPageSize = 15 ,
@@ -574,7 +552,6 @@ public async Task CreateManagedConnectorAsync_WithTechnicalUser_ReturnsCreatedCo
574552 } ) , _sdFactoryBusinessLogic , _identityService , _serviceAccountManagement , _dateTimeProvider , A . Fake < ILogger < ConnectorsBusinessLogic > > ( ) ) ;
575553
576554 SetupTechnicalIdentity ( ) ;
577- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
578555
579556 // Act
580557 var result = await sut . CreateManagedConnectorAsync ( connectorInput , CancellationToken . None ) ;
@@ -611,8 +588,7 @@ public async Task CreateManagedConnectorAsync_WithExistingConnector_ThrowsConfli
611588 public async Task CreateManagedConnectorAsync_WithInvalidLocation_ThrowsControllerArgumentException ( )
612589 {
613590 // Arrange
614- var sa01 = Guid . NewGuid ( ) ;
615- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , "invalid" , _validOfferSubscriptionId , sa01 ) ;
591+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , "invalid" , _validOfferSubscriptionId , null ) ;
616592
617593 // Act
618594 async Task Act ( ) => await _logic . CreateManagedConnectorAsync ( connectorInput , CancellationToken . None ) ;
@@ -630,11 +606,10 @@ public async Task CreateManagedConnectorAsync_WithInvalidLocation_ThrowsControll
630606 public async Task CreateManagedConnectorAsync_WithNotExistingSubscription_ThrowsNotFoundException ( )
631607 {
632608 // Arrange
633- var sa01 = Guid . NewGuid ( ) ;
634609 var subscriptionId = Guid . NewGuid ( ) ;
635610 A . CallTo ( ( ) => _offerSubscriptionRepository . CheckOfferSubscriptionWithOfferProvider ( subscriptionId , ValidCompanyId ) )
636611 . Returns ( ( false , default , default , default , default , default , default ) ) ;
637- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , sa01 ) ;
612+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , null ) ;
638613
639614 SetupTechnicalIdentity ( ) ;
640615
@@ -650,11 +625,10 @@ public async Task CreateManagedConnectorAsync_WithNotExistingSubscription_Throws
650625 public async Task CreateManagedConnectorAsync_WithCallerNotOfferProvider_ThrowsForbiddenException ( )
651626 {
652627 // Arrange
653- var sa01 = Guid . NewGuid ( ) ;
654628 var subscriptionId = Guid . NewGuid ( ) ;
655629 A . CallTo ( ( ) => _offerSubscriptionRepository . CheckOfferSubscriptionWithOfferProvider ( subscriptionId , ValidCompanyId ) )
656630 . Returns ( ( true , false , default , default , default , default , default ) ) ;
657- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , sa01 ) ;
631+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , null ) ;
658632
659633 SetupTechnicalIdentity ( ) ;
660634
@@ -670,11 +644,10 @@ public async Task CreateManagedConnectorAsync_WithCallerNotOfferProvider_ThrowsF
670644 public async Task CreateManagedConnectorAsync_WithOfferAlreadyLinked_ThrowsUnexpectedConditionException ( )
671645 {
672646 // Arrange
673- var sa01 = Guid . NewGuid ( ) ;
674647 var subscriptionId = Guid . NewGuid ( ) ;
675648 A . CallTo ( ( ) => _offerSubscriptionRepository . CheckOfferSubscriptionWithOfferProvider ( subscriptionId , ValidCompanyId ) )
676649 . Returns ( ( true , true , true , default , default , default , default ) ) ;
677- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , sa01 ) ;
650+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , null ) ;
678651
679652 SetupTechnicalIdentity ( ) ;
680653
@@ -690,11 +663,10 @@ public async Task CreateManagedConnectorAsync_WithOfferAlreadyLinked_ThrowsUnexp
690663 public async Task CreateManagedConnectorAsync_WithInactiveSubscription_ThrowsUnexpectedConditionException ( )
691664 {
692665 // Arrange
693- var sa01 = Guid . NewGuid ( ) ;
694666 var subscriptionId = Guid . NewGuid ( ) ;
695667 A . CallTo ( ( ) => _offerSubscriptionRepository . CheckOfferSubscriptionWithOfferProvider ( subscriptionId , ValidCompanyId ) )
696668 . Returns ( ( true , true , false , OfferSubscriptionStatusId . INACTIVE , default , default , default ) ) ;
697- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , sa01 ) ;
669+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , null ) ;
698670
699671 SetupTechnicalIdentity ( ) ;
700672
@@ -710,12 +682,10 @@ public async Task CreateManagedConnectorAsync_WithInactiveSubscription_ThrowsUne
710682 public async Task CreateManagedConnectorAsync_WithoutExistingSelfDescriptionDocument_ThrowsUnexpectedException ( )
711683 {
712684 // Arrange
713- var sa01 = Guid . NewGuid ( ) ;
714685 var subscriptionId = Guid . NewGuid ( ) ;
715686 A . CallTo ( ( ) => _offerSubscriptionRepository . CheckOfferSubscriptionWithOfferProvider ( subscriptionId , A < Guid > . That . Matches ( x => x == ValidCompanyId ) ) )
716687 . Returns ( ( true , true , false , OfferSubscriptionStatusId . ACTIVE , null , ValidCompanyId , ValidCompanyBpn ) ) ;
717- var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , sa01 ) ;
718- A . CallTo ( ( ) => _technicalUserRepository . CheckTechnicalUserDetailsAsync ( A < Guid > . _ , A < Guid > . _ ) ) . Returns ( ( true , false ) ) ;
688+ var connectorInput = new ManagedConnectorInputModel ( "connectorName" , "https://test.de" , CountryCode_de , subscriptionId , null ) ;
719689
720690 // Act
721691 async Task Act ( ) => await _logic . CreateManagedConnectorAsync ( connectorInput , CancellationToken . None ) ;
0 commit comments