-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hotfix/add-local-profile-legal-entity-task
- Loading branch information
Showing
128 changed files
with
502 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
BB_VERSION=2024.03.3-LTS | ||
STREAM_VERSION=4.0.0 | ||
BB_VERSION=2024.04 | ||
STREAM_VERSION=5.0.0 | ||
STREAM_REGISTRY=harbor.backbase.eu/development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
stream-approvals/approvals-core/src/test/java/com/backbase/stream/ApprovalSagaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package com.backbase.stream; | ||
|
||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.mockito.ArgumentMatchers.any; | ||
import static org.mockito.Mockito.when; | ||
|
||
import com.backbase.dbs.accesscontrol.api.service.v3.model.FunctionGroupItem; | ||
import com.backbase.stream.approval.model.Approval; | ||
import com.backbase.stream.approval.model.ApprovalType; | ||
import com.backbase.stream.approval.model.ApprovalTypeAssignmentItem; | ||
import com.backbase.stream.approval.model.IntegrationPolicyAssignmentRequestBounds; | ||
import com.backbase.stream.approval.model.Policy; | ||
import com.backbase.stream.approval.model.PolicyAssignment; | ||
import com.backbase.stream.approval.model.PolicyAssignmentItem; | ||
import com.backbase.stream.approval.model.PolicyItem; | ||
import com.backbase.stream.approval.model.PolicyLogicalItem; | ||
import com.backbase.stream.legalentity.model.ServiceAgreement; | ||
import com.backbase.stream.service.AccessGroupService; | ||
import com.backbase.stream.service.ApprovalsIntegrationService; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import reactor.core.publisher.Mono; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class ApprovalSagaTest { | ||
|
||
@Mock | ||
private AccessGroupService accessGroupService; | ||
|
||
@Mock | ||
private ApprovalsIntegrationService approvalsIntegrationService; | ||
|
||
@InjectMocks | ||
ApprovalSaga approvalSaga; | ||
|
||
@Test | ||
void executeTask() { | ||
String approvalName = "high level approvals"; | ||
Approval approval = new Approval() | ||
.name(approvalName) | ||
.addPoliciesItem(new Policy(List.of(new PolicyLogicalItem().rank(BigDecimal.ONE) | ||
.addItemsItem(new PolicyItem().approvalTypeName("Level A").numberOfApprovals(BigDecimal.ONE))), | ||
List.of())) | ||
.addApprovalTypesItem( | ||
new ApprovalType().rank(BigDecimal.ONE).name("Level A").description("Level A Approvals")) | ||
.addPolicyAssignmentsItem(new PolicyAssignment().externalServiceAgreementId("externalId") | ||
.addApprovalTypeAssignmentsItem( | ||
new ApprovalTypeAssignmentItem().approvalTypeName("Level A").jobProfileName("All")) | ||
.addPolicyAssignmentItemsItem(new PolicyAssignmentItem().externalServiceAgreementId("externalId") | ||
.addFunctionsItem("Assign Users") | ||
.addBoundsItem(new IntegrationPolicyAssignmentRequestBounds("id").policyName("Dual Control")) | ||
.addBoundsItem(new IntegrationPolicyAssignmentRequestBounds(null).policyName("Control")))); | ||
ApprovalTask approvalTask = new ApprovalTask(approval); | ||
|
||
when(accessGroupService.getFunctionGroupsForServiceAgreement(any())).thenReturn( | ||
Mono.just(List.of(new FunctionGroupItem().name("name").id("id")))); | ||
when(accessGroupService.getServiceAgreementByExternalId(any())).thenReturn( | ||
Mono.just(new ServiceAgreement().internalId("id"))); | ||
var value = approvalSaga.executeTask(approvalTask).block(); | ||
assertEquals(approvalName, value.getApproval().getName()); | ||
} | ||
|
||
@Test | ||
void rollBack() { | ||
ApprovalTask streamTask = Mockito.spy(new ApprovalTask()); | ||
Mono<ApprovalTask> approvalTaskMono = approvalSaga.rollBack(streamTask); | ||
|
||
assertNotNull(approvalTaskMono); | ||
|
||
approvalTaskMono.block(); | ||
|
||
Mockito.verify(streamTask, Mockito.never()).getData(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.