@Override public EndpointProfileBodyDto findEndpointProfileBodyByKeyHash(byte[] endpointProfileKeyHash) { validateHash(endpointProfileKeyHash, "Can't find endpoint profile by key hash. Invalid key " + "hash " + endpointProfileKeyHash); return endpointProfileDao.findBodyByKeyHash(endpointProfileKeyHash); }
@Test public void testFindBodyByKeyHash() throws Exception { EndpointProfileDto expected = generateEndpointProfileWithEndpointGroupId(null); EndpointProfileBodyDto found = endpointProfileDao.findBodyByKeyHash(expected.getEndpointKeyHash()); Assert.assertFalse(found.getClientSideProfile().isEmpty()); Assert.assertFalse(found.getServerSideProfile().isEmpty()); Assert.assertEquals(expected.getClientProfileBody(), found.getClientSideProfile()); Assert.assertEquals(expected.getServerProfileBody(), found.getServerSideProfile()); }
@Test public void findBodyByKeyHashTest() { EndpointProfileDto endpointProfile = generateEndpointProfileDto(null, null); Assert.assertNotNull(endpointProfile); EndpointProfileBodyDto found = endpointProfileDao.findBodyByKeyHash(endpointProfile.getEndpointKeyHash()); Assert.assertNotNull(found); Assert.assertEquals(endpointProfile.getClientProfileBody(), found.getClientSideProfile()); Assert.assertEquals(endpointProfile.getServerProfileBody(), found.getServerSideProfile()); }