Mikhail Efremov created IGNITE-22355:
----------------------------------------

             Summary: TableManager's static mocks from 
#mockManagersAndCreateTableWithDelay don't work
                 Key: IGNITE-22355
                 URL: https://issues.apache.org/jira/browse/IGNITE-22355
             Project: Ignite
          Issue Type: Bug
            Reporter: Mikhail Efremov
            Assignee: Mikhail Efremov


*Description*

In tests table creation method there is code like below:

 
{code:java}
try (MockedStatic<AffinityUtils> affinityServiceMock = 
mockStatic(AffinityUtils.class)) {
    ArrayList<List<ClusterNode>> assignment = new ArrayList<>(PARTITIONS);

    for (int part = 0; part < PARTITIONS; part++) {
        assignment.add(new ArrayList<>(Collections.singleton(node)));
    }

    affinityServiceMock.when(() -> AffinityUtils.calculateAssignments(any(), 
anyInt(), anyInt()))
            .thenReturn(assignment);
}{code}
As the result {{AffinityUtils#calculateAssignments}} calls outside of 
try-with-resources returns List of empty sets, but desired behavior is list of 
sets with the given {{{}node{}}}.

*Definition of done*

{{AffinityUtils#calculateAssignments}} call inside 
{{TableManager#getOrCreateAssignments}} must returns list of non-empty sets 
with single node.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to