@Test(expected = KaaOptimisticLockingFailureException.class) public void createDuplicateProfileTest() { EndpointProfileDto endpointProfileDto = generateEndpointProfileWithGroupIdDto("124"); endpointProfileDto.setVersion(null); endpointService.saveEndpointProfile(endpointProfileDto); }
cfGroupStateUpdate.add(new EndpointGroupStateDto("444", null, null)); EndpointProfileDto endpointProfileUpdate = generateEndpointProfileForTestUpdate(saved.getId(), "TEST_KEY_HASH".getBytes(), cfGroupStateUpdate); endpointProfileUpdate.setVersion(saved.getVersion()); endpointProfileDao.save(endpointProfileUpdate); String limit = "10";
+ "existing profile!", keyHash); endpointProfileDto.setId(storedProfile.getId()); endpointProfileDto.setVersion(storedProfile.getVersion()); dto = getDto(endpointProfileDao.save(endpointProfileDto)); } else {
cfGroupStateUpdate.add(new EndpointGroupStateDto("444", null, null)); EndpointProfileDto endpointProfileUpdate = generateEndpointProfileForTestUpdate(endpointProfileId, keyHash, cfGroupStateUpdate); endpointProfileUpdate.setVersion(saved.getVersion()); saved = endpointProfileDao.save(endpointProfileUpdate); String limit = "10";
@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()); }
: ""); dto.setUseConfigurationRawSchema(useConfigurationRawSchema); dto.setVersion(version); return dto;
dto.setServerProfileBody(serverProfile); dto.setUseConfigurationRawSchema(useConfigurationRawSchema); dto.setVersion(version); dto.setEpsConfigurationHash(getBytes(epsConfigurationHash)); return dto;