fix bug: lwm2m tests dif Port Comments 1

This commit is contained in:
nick 2024-04-11 12:25:44 +03:00
parent 6c3c9f99b9
commit 934287a380
3 changed files with 8 additions and 12 deletions

View File

@ -50,14 +50,12 @@ public abstract class AbstractLwM2MIntegrationDiffPortTest extends AbstractSecur
doAnswer((invocation) -> {
Object[] arguments = invocation.getArguments();
log.warn("doAnswer for registrationStoreTest.updateRegistration with args {}", arguments);
// if (arguments.length > 0 && arguments[0] instanceof RegistrationUpdate) {
log.trace("doAnswer for registrationStoreTest.updateRegistration with args {}", arguments);
int portOld = ((RegistrationUpdate) arguments[0]).getPort();
int portValueChange = 5;
arguments[0] = registrationUpdateNewPort((RegistrationUpdate) arguments[0], portValueChange);
int portNew = ((RegistrationUpdate) arguments[0]).getPort();
Assert.assertEquals((portNew - portOld), portValueChange);
// }
return invocation.callRealMethod();
}).when(registrationStoreTest).updateRegistration(any(RegistrationUpdate.class));

View File

@ -147,8 +147,7 @@ public class TbInMemoryRegistrationStore implements RegistrationStore, Startable
@Override
public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
// test fix bug Diff port
log.trace("updateRegistration inMemory {}", update);
log.trace("updateRegistration [{}]", update);
try {
lock.writeLock().lock();

View File

@ -222,8 +222,7 @@ public class TbLwM2mRedisRegistrationStore implements RegistrationStore, Startab
@Override
public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
// test fix bug Diff port
log.trace("updateRegistration Redis {}", update);
log.trace("updateRegistration [{}]", update);
Lock lock = null;
try (var connection = connectionFactory.getConnection()) {