use of org.apache.atlas.model.profile.AtlasUserSavedSearch in project atlas by apache.
the class UserProfileServiceTest method attemptToAddExistingSearch.
@Test(dependsOnMethods = "saveSearchesForUser", expectedExceptions = AtlasBaseException.class)
public void attemptToAddExistingSearch() throws AtlasBaseException {
String userName = getIndexBasedUserName(0);
SearchParameters expectedSearchParameter = getActualSearchParameters();
for (int j = 0; j < NUM_SEARCHES; j++) {
String queryName = getIndexBasedQueryName(j);
AtlasUserSavedSearch expected = getDefaultSavedSearch(userName, queryName, expectedSearchParameter);
AtlasUserSavedSearch actual = userProfileService.addSavedSearch(expected);
assertNotNull(actual);
assertNotNull(actual.getGuid());
assertEquals(actual.getOwnerName(), expected.getOwnerName());
assertEquals(actual.getName(), expected.getName());
assertEquals(actual.getSearchType(), expected.getSearchType());
assertEquals(actual.getSearchParameters(), expected.getSearchParameters());
}
}
Aggregations