Search in sources :

Example 26 with AtlasUserSavedSearch

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());
    }
}
Also used : SearchParameters(org.apache.atlas.model.discovery.SearchParameters) AtlasUserSavedSearch(org.apache.atlas.model.profile.AtlasUserSavedSearch) Test(org.testng.annotations.Test)

Aggregations

AtlasUserSavedSearch (org.apache.atlas.model.profile.AtlasUserSavedSearch)26 Test (org.testng.annotations.Test)13 SearchParameters (org.apache.atlas.model.discovery.SearchParameters)12 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)5 AtlasUserProfile (org.apache.atlas.model.profile.AtlasUserProfile)5 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)4 AtlasObjectId (org.apache.atlas.model.instance.AtlasObjectId)4 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 AtlasServiceException (org.apache.atlas.AtlasServiceException)2 Timed (org.apache.atlas.annotation.Timed)2 AtlasEntityWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo)2 AtlasPerfTracer (org.apache.atlas.utils.AtlasPerfTracer)2 IOException (java.io.IOException)1 QuickSearchParameters (org.apache.atlas.model.discovery.QuickSearchParameters)1 AbstractDataTransferObject (org.apache.atlas.repository.ogm.AbstractDataTransferObject)1