FINERACT-2185: User management improvement

This commit is contained in:
Marta Jankovics
2025-04-23 09:56:05 +02:00
committed by Adam Saghy
parent 8d83b5547c
commit 79c006774e
28 changed files with 506 additions and 95 deletions
@@ -101,7 +101,7 @@ public class CommandServiceStepDefinitions implements En {
public DummyCommand() {
super(null, null, null, null, null, null, null, null, null, null, "{}", null, null, null, null, null, null,
UUID.randomUUID().toString(), null);
UUID.randomUUID().toString(), null, null);
}
@Override
@@ -29,6 +29,7 @@ import org.apache.fineract.commands.domain.CommandSource;
import org.apache.fineract.commands.domain.CommandSourceRepository;
import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.infrastructure.codes.exception.CodeNotFoundException;
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
import org.apache.fineract.infrastructure.core.exception.ErrorHandler;
@@ -48,6 +49,9 @@ import org.mockito.MockitoAnnotations;
@SuppressFBWarnings(value = "RV_EXCEPTION_NOT_THROWN", justification = "False positive")
public class CommandSourceServiceTest {
@Mock
private ConfigurationDomainService configurationDomainService;
@Mock
private CommandSourceRepository commandSourceRepository;
@@ -77,7 +77,7 @@ public class IdempotencyKeyResolverTest {
public void testIPKResolveFromWrapper() {
String idk = "idk";
CommandWrapper wrapper = new CommandWrapper(null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, idk, null);
null, null, null, idk, null, null);
String resolvedIdk = underTest.resolve(wrapper);
Assertions.assertEquals(idk, resolvedIdk);
}
@@ -117,7 +117,7 @@ public class SynchronousCommandProcessingServiceTest {
when(commandSource.getStatus()).thenReturn(CommandProcessingResultType.PROCESSED.getValue());
when(context.authenticatedUser(Mockito.any(CommandWrapper.class))).thenReturn(appUser);
when(commandSourceService.processCommand(commandHandler, jsonCommand, commandSource, appUser, false, false))
when(commandSourceService.processCommand(commandHandler, jsonCommand, commandSource, appUser, false))
.thenReturn(commandProcessingResult);
CommandProcessingResult actualCommandProcessingResult = underTest.executeCommand(commandWrapper, jsonCommand, false);
@@ -163,8 +163,7 @@ public class SynchronousCommandProcessingServiceTest {
when(commandSourceService.findCommandSource(commandWrapper, idk)).thenReturn(initialCommandSource);
when(commandSourceService.processCommand(commandHandler, jsonCommand, commandSource, appUser, false, false))
.thenThrow(runtimeException);
when(commandSourceService.processCommand(commandHandler, jsonCommand, commandSource, appUser, false)).thenThrow(runtimeException);
assertThrows(RuntimeException.class, () -> {
underTest.executeCommand(commandWrapper, jsonCommand, false);