FINERACT-2091: Support for string type primary keys

This commit is contained in:
Marta Jankovics
2024-06-13 20:29:23 +02:00
committed by Adam Saghy
parent 111e28ed1b
commit f48f94c454
216 changed files with 243 additions and 273 deletions
@@ -142,6 +142,7 @@ public class SynchronousCommandProcessingServiceTest {
NewCommandSourceHandler commandHandler = Mockito.mock(NewCommandSourceHandler.class);
CommandProcessingResult commandProcessingResult = Mockito.mock(CommandProcessingResult.class);
CommandSource commandSource = Mockito.mock(CommandSource.class);
when(commandSource.getId()).thenReturn(1L);
when(commandProcessingResult.isRollbackTransaction()).thenReturn(false);
RuntimeException runtimeException = new RuntimeException("foo");
when(commandHandler.processCommand(jsonCommand)).thenThrow(runtimeException);
@@ -154,6 +155,7 @@ public class SynchronousCommandProcessingServiceTest {
when(commandSourceService.getCommandSource(commandId)).thenReturn(commandSource);
AppUser appUser = Mockito.mock(AppUser.class);
when(appUser.getId()).thenReturn(1L);
when(context.authenticatedUser(Mockito.any(CommandWrapper.class))).thenReturn(appUser);
when(commandSourceService.saveInitialNewTransaction(commandWrapper, jsonCommand, appUser, idk)).thenReturn(commandSource);
@@ -58,7 +58,7 @@ public class CustomAuditingHandlerTest {
public void markCreated() {
MappingContext mappingContext = Mockito.mock(MappingContext.class);
CustomAuditingHandler testInstance = new CustomAuditingHandler(PersistentEntities.of(mappingContext));
AbstractAuditableWithUTCDateTimeCustom targetObject = Mockito.spy(AbstractAuditableWithUTCDateTimeCustom.class);
AbstractAuditableWithUTCDateTimeCustom<Long> targetObject = Mockito.spy(AbstractAuditableWithUTCDateTimeCustom.class);
targetObject = testInstance.markCreated(targetObject);
OffsetDateTime now = DateUtils.getAuditOffsetDateTime();
@@ -74,7 +74,7 @@ public class CustomAuditingHandlerTest {
public void markModified() {
MappingContext mappingContext = Mockito.mock(MappingContext.class);
CustomAuditingHandler testInstance = new CustomAuditingHandler(PersistentEntities.of(mappingContext));
AbstractAuditableWithUTCDateTimeCustom targetObject = Mockito.spy(AbstractAuditableWithUTCDateTimeCustom.class);
AbstractAuditableWithUTCDateTimeCustom<Long> targetObject = Mockito.spy(AbstractAuditableWithUTCDateTimeCustom.class);
targetObject = testInstance.markModified(targetObject);
OffsetDateTime now = DateUtils.getAuditOffsetDateTime();
@@ -572,6 +572,7 @@ public class DelinquencyWritePlatformServiceRangeChangeEventTest {
.forClass(LoanDelinquencyRangeChangeBusinessEvent.class);
// given
Loan loanForProcessing = Mockito.mock(Loan.class);
when(loanForProcessing.getId()).thenReturn(1L);
DelinquencyRange range1 = DelinquencyRange.instance("Range1", 1, 2);
range1.setId(1L);
DelinquencyRange range2 = DelinquencyRange.instance("Range30", 3, 30);
@@ -603,7 +604,7 @@ public class DelinquencyWritePlatformServiceRangeChangeEventTest {
.forClass(LoanAccountDelinquencyPauseChangedBusinessEvent.class);
// given
Loan loanForProcessing = Mockito.mock(Loan.class);
loanForProcessing.setId(1L);
when(loanForProcessing.getId()).thenReturn(1L);
JsonCommand command = Mockito.mock(JsonCommand.class);
@@ -654,7 +655,7 @@ public class DelinquencyWritePlatformServiceRangeChangeEventTest {
.forClass(LoanDelinquencyRangeChangeBusinessEvent.class);
// given
Loan loanForProcessing = Mockito.mock(Loan.class);
loanForProcessing.setId(1L);
when(loanForProcessing.getId()).thenReturn(1L);
JsonCommand command = Mockito.mock(JsonCommand.class);