@Override public MongoEndpointProfile save(EndpointProfileDto dto) { return save(new MongoEndpointProfile(dto)); }
@Override public void run() { try { MongoEndpointProfile ep = new MongoEndpointProfile(endpointProfile); ep.setEndpointUserId("Ololo " + id); endpointProfileDao.save(ep.toDto()); } catch (KaaOptimisticLockingFailureException ex) { LOG.error("Catch optimistic exception."); throw ex; } } }));
@Test public void convertToDtoTest() { EndpointProfileDto endpointProfile = generateEndpointProfileDto(null, null); endpointProfile.setAccessToken("Trololo"); endpointProfileDao.save(endpointProfile); Assert.assertNotNull(endpointProfile); MongoEndpointProfile converted = new MongoEndpointProfile(endpointProfile); Assert.assertEquals(endpointProfile, converted.toDto()); }
@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()); }
@Test public void getSetTest() { MongoEndpointProfile profile = new MongoEndpointProfile();