Search in sources :

Example 1 with BusinessObjectDefinitionSearchResponse

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testSearchBusinessObjectDefinitionsOnlyShortDescription.

@Test
public void testSearchBusinessObjectDefinitionsOnlyShortDescription() {
    // Set up test data.
    Set<BusinessObjectDefinition> expectedBusinessObjectDefinitions = new HashSet<>(setUpTestEntitiesForSearchTesting());
    // Remove fields which are not expected from the expected business object definition objects.
    for (BusinessObjectDefinition businessObjectDefinition : expectedBusinessObjectDefinitions) {
        businessObjectDefinition.setDisplayName(null);
        businessObjectDefinition.setDataProviderName(null);
    }
    // Retrieve the actual business object definition objects from the search response.
    BusinessObjectDefinitionSearchResponse searchResponse = businessObjectDefinitionService.searchBusinessObjectDefinitions(new BusinessObjectDefinitionSearchRequest(Arrays.asList(new BusinessObjectDefinitionSearchFilter(NO_EXCLUSION_SEARCH_FILTER, Arrays.asList(new BusinessObjectDefinitionSearchKey(new TagKey(TAG_TYPE, TAG_CODE), INCLUDE_TAG_HIERARCHY))))), Sets.newHashSet(FIELD_SHORT_DESCRIPTION));
    Set<BusinessObjectDefinition> actualBusinessObjectDefinitions = new HashSet<>(searchResponse.getBusinessObjectDefinitions());
    assertTrue(CollectionUtils.isEqualCollection(expectedBusinessObjectDefinitions, actualBusinessObjectDefinitions));
}
Also used : BusinessObjectDefinition(org.finra.herd.model.api.xml.BusinessObjectDefinition) BusinessObjectDefinitionSearchKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchKey) TagKey(org.finra.herd.model.api.xml.TagKey) BusinessObjectDefinitionSearchRequest(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest) BusinessObjectDefinitionSearchFilter(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchFilter) HashSet(java.util.HashSet) BusinessObjectDefinitionSearchResponse(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse) Test(org.junit.Test)

Example 2 with BusinessObjectDefinitionSearchResponse

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testSearchBusinessObjectDefinitionLowerCaseParams.

@Test
public void testSearchBusinessObjectDefinitionLowerCaseParams() {
    // Set up test data.
    Set<BusinessObjectDefinition> expectedBusinessObjectDefinitions = setUpTestEntitiesForSearchTesting();
    // Retrieve the actual business object definition objects from the search response.
    BusinessObjectDefinitionSearchResponse searchResponse = businessObjectDefinitionService.searchBusinessObjectDefinitions(new BusinessObjectDefinitionSearchRequest(Arrays.asList(new BusinessObjectDefinitionSearchFilter(NO_EXCLUSION_SEARCH_FILTER, Arrays.asList(new BusinessObjectDefinitionSearchKey(new TagKey(TAG_TYPE, TAG_CODE), INCLUDE_TAG_HIERARCHY))))), Sets.newHashSet(FIELD_DATA_PROVIDER_NAME.toLowerCase(), FIELD_DISPLAY_NAME.toLowerCase(), FIELD_SHORT_DESCRIPTION.toLowerCase()));
    Set<BusinessObjectDefinition> actualBusinessObjectDefinitions = new HashSet<>(searchResponse.getBusinessObjectDefinitions());
    assertEquals(expectedBusinessObjectDefinitions, actualBusinessObjectDefinitions);
}
Also used : BusinessObjectDefinition(org.finra.herd.model.api.xml.BusinessObjectDefinition) BusinessObjectDefinitionSearchKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchKey) TagKey(org.finra.herd.model.api.xml.TagKey) BusinessObjectDefinitionSearchRequest(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest) BusinessObjectDefinitionSearchFilter(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchFilter) BusinessObjectDefinitionSearchResponse(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 3 with BusinessObjectDefinitionSearchResponse

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testBusinessObjectDefinitionNoHtmlInShortDescription.

@Test
public void testBusinessObjectDefinitionNoHtmlInShortDescription() {
    // Set up test data.
    setUpTestEntitiesForSearchTesting();
    // Retrieve the actual business object definition objects from the search response.
    BusinessObjectDefinitionSearchResponse searchResponse = businessObjectDefinitionService.searchBusinessObjectDefinitions(new BusinessObjectDefinitionSearchRequest(Arrays.asList(new BusinessObjectDefinitionSearchFilter(NO_EXCLUSION_SEARCH_FILTER, Arrays.asList(new BusinessObjectDefinitionSearchKey(new TagKey(TAG_TYPE, TAG_CODE_4), INCLUDE_TAG_HIERARCHY))))), Sets.newHashSet(FIELD_SHORT_DESCRIPTION));
    Set<BusinessObjectDefinition> actualBusinessObjectDefinitions = new HashSet<>(searchResponse.getBusinessObjectDefinitions());
    assertEquals(1, actualBusinessObjectDefinitions.size());
    for (BusinessObjectDefinition actualBdef : actualBusinessObjectDefinitions) {
        assertEquals("Test Description. Value should be <30> value should be <40>", actualBdef.getShortDescription());
        break;
    }
}
Also used : BusinessObjectDefinitionSearchKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchKey) BusinessObjectDefinition(org.finra.herd.model.api.xml.BusinessObjectDefinition) TagKey(org.finra.herd.model.api.xml.TagKey) BusinessObjectDefinitionSearchRequest(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest) BusinessObjectDefinitionSearchFilter(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchFilter) BusinessObjectDefinitionSearchResponse(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 4 with BusinessObjectDefinitionSearchResponse

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testSearchBusinessObjectDefinitionsOnlyDataProviderNameAndDisplayName.

@Test
public void testSearchBusinessObjectDefinitionsOnlyDataProviderNameAndDisplayName() {
    // Set up test data.
    Set<BusinessObjectDefinition> expectedBusinessObjectDefinitions = setUpTestEntitiesForSearchTesting();
    // Remove fields which are not expected from the expected business object definition objects.
    for (BusinessObjectDefinition businessObjectDefinition : expectedBusinessObjectDefinitions) {
        businessObjectDefinition.setShortDescription(null);
    }
    // Retrieve the actual business object definition objects from the search response.
    BusinessObjectDefinitionSearchResponse searchResponse = businessObjectDefinitionService.searchBusinessObjectDefinitions(new BusinessObjectDefinitionSearchRequest(Arrays.asList(new BusinessObjectDefinitionSearchFilter(NO_EXCLUSION_SEARCH_FILTER, Arrays.asList(new BusinessObjectDefinitionSearchKey(new TagKey(TAG_TYPE, TAG_CODE), INCLUDE_TAG_HIERARCHY))))), Sets.newHashSet(FIELD_DATA_PROVIDER_NAME, FIELD_DISPLAY_NAME));
    Set<BusinessObjectDefinition> actualBusinessObjectDefinitions = new HashSet<>(searchResponse.getBusinessObjectDefinitions());
    assertEquals(actualBusinessObjectDefinitions, expectedBusinessObjectDefinitions);
}
Also used : BusinessObjectDefinition(org.finra.herd.model.api.xml.BusinessObjectDefinition) BusinessObjectDefinitionSearchKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchKey) TagKey(org.finra.herd.model.api.xml.TagKey) BusinessObjectDefinitionSearchRequest(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest) BusinessObjectDefinitionSearchFilter(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchFilter) BusinessObjectDefinitionSearchResponse(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 5 with BusinessObjectDefinitionSearchResponse

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testSearchBusinessObjectDefinitionEmptyFilter.

@Test
public void testSearchBusinessObjectDefinitionEmptyFilter() {
    // Set up test data.
    Set<BusinessObjectDefinition> expectedBusinessObjectDefinitions = setUpTestEntitiesForSearchTesting();
    // Retrieve the actual business object definition objects from the search response.
    BusinessObjectDefinitionSearchResponse searchResponse = businessObjectDefinitionService.searchBusinessObjectDefinitions(new BusinessObjectDefinitionSearchRequest(), Sets.newHashSet(FIELD_DATA_PROVIDER_NAME, FIELD_DISPLAY_NAME, FIELD_SHORT_DESCRIPTION));
    Set<BusinessObjectDefinition> actualBusinessObjectDefinitions = new HashSet<>(searchResponse.getBusinessObjectDefinitions());
    assertEquals(expectedBusinessObjectDefinitions, actualBusinessObjectDefinitions);
}
Also used : BusinessObjectDefinition(org.finra.herd.model.api.xml.BusinessObjectDefinition) BusinessObjectDefinitionSearchRequest(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest) BusinessObjectDefinitionSearchResponse(org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

BusinessObjectDefinition (org.finra.herd.model.api.xml.BusinessObjectDefinition)14 BusinessObjectDefinitionSearchResponse (org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchResponse)14 BusinessObjectDefinitionSearchKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchKey)13 BusinessObjectDefinitionSearchRequest (org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchRequest)13 Test (org.junit.Test)13 HashSet (java.util.HashSet)12 BusinessObjectDefinitionSearchFilter (org.finra.herd.model.api.xml.BusinessObjectDefinitionSearchFilter)12 TagKey (org.finra.herd.model.api.xml.TagKey)12 ArrayList (java.util.ArrayList)1 Attribute (org.finra.herd.model.api.xml.Attribute)1 DescriptiveBusinessObjectFormat (org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormat)1 SampleDataFile (org.finra.herd.model.api.xml.SampleDataFile)1 BusinessObjectDefinitionEntity (org.finra.herd.model.jpa.BusinessObjectDefinitionEntity)1 TagEntity (org.finra.herd.model.jpa.TagEntity)1