fix bug: lwm2m tests dif Port Comments 1
This commit is contained in:
		
							parent
							
								
									6c3c9f99b9
								
							
						
					
					
						commit
						934287a380
					
				@ -50,14 +50,12 @@ public abstract class AbstractLwM2MIntegrationDiffPortTest extends AbstractSecur
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        doAnswer((invocation) -> {
 | 
					        doAnswer((invocation) -> {
 | 
				
			||||||
            Object[] arguments = invocation.getArguments();
 | 
					            Object[] arguments = invocation.getArguments();
 | 
				
			||||||
            log.warn("doAnswer for registrationStoreTest.updateRegistration with args {}", arguments);
 | 
					            log.trace("doAnswer for registrationStoreTest.updateRegistration with args {}", arguments);
 | 
				
			||||||
//            if (arguments.length > 0 && arguments[0] instanceof RegistrationUpdate) {
 | 
					            int portOld = ((RegistrationUpdate) arguments[0]).getPort();
 | 
				
			||||||
                int portOld = ((RegistrationUpdate) arguments[0]).getPort();
 | 
					            int portValueChange = 5;
 | 
				
			||||||
                int portValueChange = 5;
 | 
					            arguments[0] = registrationUpdateNewPort((RegistrationUpdate) arguments[0], portValueChange);
 | 
				
			||||||
                arguments[0] = registrationUpdateNewPort((RegistrationUpdate) arguments[0], portValueChange);
 | 
					            int portNew =  ((RegistrationUpdate) arguments[0]).getPort();
 | 
				
			||||||
                int portNew =  ((RegistrationUpdate) arguments[0]).getPort();
 | 
					            Assert.assertEquals((portNew - portOld), portValueChange);
 | 
				
			||||||
                Assert.assertEquals((portNew - portOld), portValueChange);
 | 
					 | 
				
			||||||
//            }
 | 
					 | 
				
			||||||
            return invocation.callRealMethod();
 | 
					            return invocation.callRealMethod();
 | 
				
			||||||
        }).when(registrationStoreTest).updateRegistration(any(RegistrationUpdate.class));
 | 
					        }).when(registrationStoreTest).updateRegistration(any(RegistrationUpdate.class));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -147,8 +147,7 @@ public class TbInMemoryRegistrationStore implements RegistrationStore, Startable
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
 | 
					    public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
 | 
				
			||||||
        // test fix bug Diff port
 | 
					        log.trace("updateRegistration [{}]", update);
 | 
				
			||||||
        log.trace("updateRegistration inMemory {}", update);
 | 
					 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            lock.writeLock().lock();
 | 
					            lock.writeLock().lock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -222,8 +222,7 @@ public class TbLwM2mRedisRegistrationStore implements RegistrationStore, Startab
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
 | 
					    public UpdatedRegistration updateRegistration(RegistrationUpdate update) {
 | 
				
			||||||
        // test fix bug Diff port
 | 
					        log.trace("updateRegistration [{}]", update);
 | 
				
			||||||
        log.trace("updateRegistration Redis {}", update);
 | 
					 | 
				
			||||||
        Lock lock = null;
 | 
					        Lock lock = null;
 | 
				
			||||||
        try (var connection = connectionFactory.getConnection()) {
 | 
					        try (var connection = connectionFactory.getConnection()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user