* 修复openApi publishConfigCas失效 * 修复openApi publishConfigCas失效 * fix unit test
This commit is contained in:
parent
5fcef225be
commit
25585d65dd
@ -88,7 +88,10 @@ public class ConfigOperationService {
|
||||
|
||||
ConfigInfo configInfo = new ConfigInfo(configForm.getDataId(), configForm.getGroup(),
|
||||
configForm.getNamespaceId(), configForm.getAppName(), configForm.getContent());
|
||||
|
||||
//set old md5
|
||||
if (StringUtils.isNotBlank(configRequestInfo.getCasMd5())) {
|
||||
configInfo.setMd5(configRequestInfo.getCasMd5());
|
||||
}
|
||||
configInfo.setType(configForm.getType());
|
||||
configInfo.setEncryptedDataKey(encryptedDataKey);
|
||||
ConfigOperateResult configOperateResult;
|
||||
|
@ -614,7 +614,7 @@ public class EmbeddedConfigInfoPersistServiceImpl implements ConfigInfoPersistSe
|
||||
context.putWhereParameter(FieldConstant.MD5, configInfo.getMd5());
|
||||
MapperResult mapperResult = configInfoMapper.updateConfigInfoAtomicCas(context);
|
||||
|
||||
EmbeddedStorageContextHolder.addSqlContext(mapperResult.getSql(), mapperResult.getParamList().toArray());
|
||||
EmbeddedStorageContextHolder.addSqlContext(Boolean.TRUE, mapperResult.getSql(), mapperResult.getParamList().toArray());
|
||||
return getConfigInfoOperateResult(configInfo.getDataId(), configInfo.getGroup(), tenantTmp);
|
||||
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ public class EmbeddedConfigInfoPersistServiceImplTest {
|
||||
embeddedConfigInfoPersistService.insertOrUpdateCas(srcIp, srcUser, configInfo, configAdvanceInfo);
|
||||
//expect update config info invoked.
|
||||
embeddedStorageContextHolderMockedStatic.verify(
|
||||
() -> EmbeddedStorageContextHolder.addSqlContext(anyString(), eq(content),
|
||||
() -> EmbeddedStorageContextHolder.addSqlContext(eq(Boolean.TRUE), anyString(), eq(content),
|
||||
eq(MD5Utils.md5Hex(content, Constants.PERSIST_ENCODE)), eq(srcIp), eq(srcUser),
|
||||
any(Timestamp.class), eq(appName), eq(desc), eq(use), eq(effect), eq(type), eq(schema),
|
||||
eq(encryptedDataKey), eq(dataId), eq(group), eq(tenant), eq(casMd5)), times(1));
|
||||
|
Loading…
Reference in New Issue
Block a user