protected EndpointProfileDto generateEndpointProfileForTestUpdate(String id, byte[] keyHash, List<EndpointGroupStateDto> groupState) { EndpointProfileDto profileDto = new EndpointProfileDto(); profileDto.setId(id); profileDto.setApplicationId(generateStringId()); profileDto.setEndpointKeyHash(keyHash); profileDto.setAccessToken(generateStringId()); profileDto.setGroupState(groupState); profileDto.setSdkToken(UUID.randomUUID().toString()); return profileDto; }
protected EndpointProfileDto generateEndpointProfileForTestUpdate(String id, byte[] keyHash, List<EndpointGroupStateDto> cfGroupState) { EndpointProfileDto profileDto = new EndpointProfileDto(); profileDto.setId(id); profileDto.setEndpointKeyHash(keyHash); profileDto.setApplicationId(generateStringId()); profileDto.setAccessToken(generateStringId()); profileDto.setGroupState(cfGroupState); profileDto.setSdkToken(UUID.randomUUID().toString()); profileDto.setEpsConfigurationHash(EPS_CONFIG_HASH); return profileDto; }
LOG.debug("Got register profile for already existing profile {}. Will overwrite " + "existing profile!", keyHash); endpointProfileDto.setId(storedProfile.getId()); endpointProfileDto.setVersion(storedProfile.getVersion()); dto = getDto(endpointProfileDao.save(endpointProfileDto));
@Test public void saveEndpointProfileTest() { EndpointProfileDto endpointProfile = generateEndpointProfileDto(null, null); Assert.assertNotNull(endpointProfile); endpointProfile.setId(null); endpointProfile.setVersion(null); MongoEndpointProfile saved = endpointProfileDao.save(new MongoEndpointProfile(endpointProfile)); Assert.assertNotNull(saved); Assert.assertEquals(endpointProfile, saved.toDto()); }
@Override public EndpointProfileDto toDto() { EndpointProfileDto dto = new EndpointProfileDto(); dto.setId(id); dto.setGroupState(DaoUtil.convertDtoList(groupState)); dto.setSequenceNumber(sequenceNumber);
@Override public EndpointProfileDto toDto() { EndpointProfileDto dto = new EndpointProfileDto(); dto.setId(id); dto.setGroupState(DaoUtil.convertDtoList(groupStates)); dto.setSequenceNumber(sequenceNumber);