fix: refresh dimension config response
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ public class CustomerDimensionConfigService {
|
||||
throw staleConfiguration();
|
||||
}
|
||||
}
|
||||
return response(tenantId, existing);
|
||||
return response(tenantId, requireCompleteRules(repository.findAll(tenantId)));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+14
@@ -140,6 +140,20 @@ class CustomerDimensionConfigServiceTest {
|
||||
verify(repository, times(2)).update(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void returnsPersistedVersionsAfterUpdatingAllRules() {
|
||||
List<CustomerDimensionConfigEntity> existing = defaultConfigs("registration-1");
|
||||
List<CustomerDimensionConfigEntity> persisted = defaultConfigs("registration-1");
|
||||
persisted.forEach(value -> value.setVersion(1));
|
||||
when(repository.findAll(8L)).thenReturn(existing, persisted);
|
||||
when(repository.update(any())).thenReturn(1);
|
||||
|
||||
GroupResponse result = service.update(8L, 100L, updateRequest(0));
|
||||
|
||||
assertThat(result.rules()).extracting(rule -> rule.version()).containsOnly(1);
|
||||
verify(repository, times(2)).findAll(8L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void savesAndReturnsTheCustomerDefaultCalculationMode() {
|
||||
List<CustomerDimensionConfigEntity> existing = defaultConfigs("registration-1");
|
||||
|
||||
Reference in New Issue
Block a user