@Override @Transactional public EndpointProfilesBodyDto findEndpointProfileBodyByEndpointGroupId(PageLinkDto pageLink) { validateSqlId(pageLink.getLimit(), "Can't find endpoint group by id. Incorrect limit parameter " + pageLink.getLimit()); validateString(pageLink.getOffset(), "Can't find endpoint group by id. Incorrect offset " + "parameter " + pageLink.getOffset()); return endpointProfileDao.findBodyByEndpointGroupId(pageLink); }
@Test public void testFindBodyByEndpointGroupIdWithNfGroupState() throws Exception { PageLinkDto pageLink = getPageLinkDto(); EndpointProfilesBodyDto found = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(found.getEndpointProfilesBody().isEmpty()); int lim = Integer.valueOf(TEST_LIMIT); Assert.assertEquals(lim, found.getEndpointProfilesBody().size()); pageLink.setApplicationId(TEST_APPID); EndpointProfilesBodyDto foundbyAppId = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(foundbyAppId.getEndpointProfilesBody().isEmpty()); Assert.assertEquals(lim, foundbyAppId.getEndpointProfilesBody().size()); }
@Test public void testFindBodyByEndpointGroupId() throws Exception { PageLinkDto pageLink = getPageLinkDto(); EndpointProfilesBodyDto found = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(found.getEndpointProfilesBody().isEmpty()); int lim = Integer.valueOf(TEST_LIMIT); Assert.assertEquals(lim, found.getEndpointProfilesBody().size()); pageLink.setApplicationId(TEST_APPID); EndpointProfilesBodyDto foundbyAppId = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(foundbyAppId.getEndpointProfilesBody().isEmpty()); Assert.assertEquals(lim, foundbyAppId.getEndpointProfilesBody().size()); }
@Test public void findBodyByEndpointGroupIdTest() { for (int i = 0; i < GENERATED_PROFILES_COUNT; i++) { generateEndpointProfileWithGroupIdDto(TEST_ENDPOINT_GROUP_ID); } int lim = Integer.valueOf(TEST_LIMIT); PageLinkDto pageLink = new PageLinkDto(TEST_ENDPOINT_GROUP_ID, TEST_LIMIT, TEST_OFFSET); EndpointProfilesBodyDto found = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(found.getEndpointProfilesBody().isEmpty()); Assert.assertEquals(lim, found.getEndpointProfilesBody().size()); }
@Test public void findBodyByEndpointGroupIdWithNfGroupStateTest() { for (int i = 0; i < GENERATED_PROFILES_COUNT; i++) { generateEndpointProfileWithGroupIdDto(TEST_ENDPOINT_GROUP_ID); } int lim = Integer.valueOf(TEST_LIMIT); PageLinkDto pageLink = new PageLinkDto(TEST_ENDPOINT_GROUP_ID, TEST_LIMIT, TEST_OFFSET); EndpointProfilesBodyDto found = endpointProfileDao.findBodyByEndpointGroupId(pageLink); Assert.assertFalse(found.getEndpointProfilesBody().isEmpty()); Assert.assertEquals(lim, found.getEndpointProfilesBody().size()); }