Search in sources :

Example 11 with ObjectNotFoundException

use of org.finra.herd.model.ObjectNotFoundException in project herd by FINRAOS.

the class EmrPricingHelperTest method testBestPriceExplicitSpotAndSpotPriceNotAvailable.

/**
 * Tests algorithmic case when spot is explicitly requested and spot price is not available. The update method should throw an error indicating that no
 * subnets satisfied the given criteria.
 */
@Test
public void testBestPriceExplicitSpotAndSpotPriceNotAvailable() {
    String subnetId = SUBNET_1;
    // For master instance definition, use instance type that does not have spot price available.
    MasterInstanceDefinition masterInstanceDefinition = new MasterInstanceDefinition();
    masterInstanceDefinition.setInstanceCount(1);
    masterInstanceDefinition.setInstanceType(INSTANCE_TYPE_4);
    masterInstanceDefinition.setInstanceSpotPrice(ON_DEMAND);
    InstanceDefinition coreInstanceDefinition = null;
    InstanceDefinition taskInstanceDefinition = null;
    // Try with master failing criteria
    try {
        updateEmrClusterDefinitionWithBestPrice(subnetId, masterInstanceDefinition, coreInstanceDefinition, taskInstanceDefinition);
        fail();
    } catch (ObjectNotFoundException e) {
        // Set expected EMR VPC price state.
        EmrVpcPricingState expectedEmrVpcPricingState = new EmrVpcPricingState();
        expectedEmrVpcPricingState.setSubnetAvailableIpAddressCounts(new HashMap<String, Integer>() {

            {
                put(SUBNET_1, 10);
            }
        });
        expectedEmrVpcPricingState.setSpotPricesPerAvailabilityZone(new HashMap<String, Map<String, BigDecimal>>() {

            {
                put(AVAILABILITY_ZONE_1, new HashMap<>());
            }
        });
        expectedEmrVpcPricingState.setOnDemandPricesPerAvailabilityZone(new HashMap<String, Map<String, BigDecimal>>() {

            {
                put(AVAILABILITY_ZONE_1, new HashMap<String, BigDecimal>() {

                    {
                        put(INSTANCE_TYPE_4, ON_DEMAND);
                    }
                });
            }
        });
        assertEquals(String.format("There were no subnets which satisfied your best price search criteria. If you explicitly opted to use spot EC2 instances, please confirm " + "that your instance types support spot pricing. Otherwise, try setting the max price or the on-demand threshold to a higher value.%n%s", emrVpcPricingStateFormatter.format(expectedEmrVpcPricingState)), e.getMessage());
    }
}
Also used : InstanceDefinition(org.finra.herd.model.api.xml.InstanceDefinition) MasterInstanceDefinition(org.finra.herd.model.api.xml.MasterInstanceDefinition) EmrVpcPricingState(org.finra.herd.model.dto.EmrVpcPricingState) HashMap(java.util.HashMap) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) MasterInstanceDefinition(org.finra.herd.model.api.xml.MasterInstanceDefinition) BigDecimal(java.math.BigDecimal) Test(org.junit.Test) AbstractDaoTest(org.finra.herd.dao.AbstractDaoTest)

Example 12 with ObjectNotFoundException

use of org.finra.herd.model.ObjectNotFoundException in project herd by FINRAOS.

the class SubjectMatterExpertServiceImpl method getSubjectMatterExpert.

@Override
public SubjectMatterExpert getSubjectMatterExpert(SubjectMatterExpertKey subjectMatterExpertKey) {
    // Validate and trim the subject matter expert key.
    validateSubjectMatterExpertKey(subjectMatterExpertKey);
    // Get the information for the subject matter expert.
    SubjectMatterExpertContactDetails subjectMatterExpertContactDetails = subjectMatterExpertDao.getSubjectMatterExpertByKey(subjectMatterExpertKey);
    if (subjectMatterExpertContactDetails == null) {
        throw new ObjectNotFoundException(String.format("The subject matter expert with user id \"%s\" does not exist.", subjectMatterExpertKey.getUserId()));
    }
    // Create and return the subject matter expert.
    return new SubjectMatterExpert(subjectMatterExpertKey, subjectMatterExpertContactDetails);
}
Also used : SubjectMatterExpert(org.finra.herd.model.api.xml.SubjectMatterExpert) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) SubjectMatterExpertContactDetails(org.finra.herd.model.api.xml.SubjectMatterExpertContactDetails)

Example 13 with ObjectNotFoundException

use of org.finra.herd.model.ObjectNotFoundException in project herd by FINRAOS.

the class AllowedAttributeValueServiceTest method testDeleteAllowedAttributeValuesNoExists.

@Test
public void testDeleteAllowedAttributeValuesNoExists() {
    // Create attribute value list key.
    AttributeValueListKey attributeValueListKey = new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
    // Create namespace entity.
    NamespaceEntity namespaceEntity = new NamespaceEntity();
    namespaceEntity.setCode(ATTRIBUTE_VALUE_LIST_NAMESPACE);
    // Create attribute value list entity.
    AttributeValueListEntity attributeValueListEntity = new AttributeValueListEntity();
    attributeValueListEntity.setId(ATTRIBUTE_VALUE_LIST_ID);
    attributeValueListEntity.setNamespace(namespaceEntity);
    attributeValueListEntity.setName(ATTRIBUTE_VALUE_LIST_NAME);
    attributeValueListEntity.setAllowedAttributeValues(new ArrayList<>());
    // Create allowed attribute value entity.
    AllowedAttributeValueEntity allowedAttributeValueEntity = new AllowedAttributeValueEntity();
    allowedAttributeValueEntity.setAllowedAttributeValue(ALLOWED_ATTRIBUTE_VALUE);
    allowedAttributeValueEntity.setAttributeValueList(attributeValueListEntity);
    // Mock calls to external method.
    when(attributeValueListDaoHelper.getAttributeValueListEntity(attributeValueListKey)).thenReturn(attributeValueListEntity);
    when(alternateKeyHelper.validateStringParameter("An", "allowed attribute value", ALLOWED_ATTRIBUTE_VALUE)).thenReturn(ALLOWED_ATTRIBUTE_VALUE);
    // Try to call method under test.
    try {
        allowedAttributeValueService.deleteAllowedAttributeValues(new AllowedAttributeValuesDeleteRequest(attributeValueListKey, Arrays.asList(ALLOWED_ATTRIBUTE_VALUE)));
        fail();
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Allowed attribute value \"%s\" doesn't exist in \"%s\" attribute value list.", ALLOWED_ATTRIBUTE_VALUE, attributeValueListEntity.getName()), e.getMessage());
    }
    // Verify the external calls.
    verify(attributeValueListDaoHelper).getAttributeValueListEntity(attributeValueListKey);
    verify(alternateKeyHelper).validateStringParameter("An", "allowed attribute value", ALLOWED_ATTRIBUTE_VALUE);
    verify(attributeValueListHelper).validateAttributeValueListKey(attributeValueListKey);
    verifyNoMoreInteractionsHelper();
}
Also used : NamespaceEntity(org.finra.herd.model.jpa.NamespaceEntity) AllowedAttributeValuesDeleteRequest(org.finra.herd.model.api.xml.AllowedAttributeValuesDeleteRequest) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) AttributeValueListEntity(org.finra.herd.model.jpa.AttributeValueListEntity) AllowedAttributeValueEntity(org.finra.herd.model.jpa.AllowedAttributeValueEntity) AttributeValueListKey(org.finra.herd.model.api.xml.AttributeValueListKey) Test(org.junit.Test)

Example 14 with ObjectNotFoundException

use of org.finra.herd.model.ObjectNotFoundException in project herd by FINRAOS.

the class BusinessObjectDataNotificationRegistrationServiceTest method testCreateBusinessObjectDataNotificationRegistrationInvalidParameters.

@Test
public void testCreateBusinessObjectDataNotificationRegistrationInvalidParameters() {
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME);
    BusinessObjectDataNotificationRegistrationCreateRequest request;
    // Create and persist the relative database entities.
    notificationRegistrationServiceTestHelper.createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting();
    // Try to create a business object data notification using non-existing namespace.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(new NotificationRegistrationKey("I_DO_NOT_EXIST", NOTIFICATION_NAME), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing namespace.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Namespace \"%s\" doesn't exist.", request.getBusinessObjectDataNotificationRegistrationKey().getNamespace()), e.getMessage());
    }
    // Try to create a business object data notification when namespace contains a forward slash character.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(new NotificationRegistrationKey(addSlash(NAMESPACE), NOTIFICATION_NAME), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an IllegalArgumentException when namespace contains a forward slash character.");
    } catch (IllegalArgumentException e) {
        assertEquals("Namespace can not contain a forward slash character.", e.getMessage());
    }
    // Try to create a business object data notification when notification name contains a forward slash character.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(new NotificationRegistrationKey(NAMESPACE, addSlash(NOTIFICATION_NAME)), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an IllegalArgumentException when notification name contains a forward slash character.");
    } catch (IllegalArgumentException e) {
        assertEquals("Notification name can not contain a forward slash character.", e.getMessage());
    }
    // Try to create a business object data notification using non-existing notification event type.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, "I_DO_NOT_EXIST", new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing notification event type.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Notification event type with code \"%s\" doesn't exist.", request.getBusinessObjectDataEventType()), e.getMessage());
    }
    // Try to create a business object data notification using non-supported notification event type.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NOTIFICATION_EVENT_TYPE, new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an IllegalArgumentException when using non-supported notification event type.");
    } catch (IllegalArgumentException e) {
        assertEquals(String.format("Notification event type \"%s\" is not supported for business object data notification registration.", request.getBusinessObjectDataEventType()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing business object definition name.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, "I_DO_NOT_EXIST", FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing business object definition name.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Business object definition with name \"%s\" doesn't exist for namespace \"%s\".", request.getBusinessObjectDataNotificationFilter().getBusinessObjectDefinitionName(), request.getBusinessObjectDataNotificationFilter().getNamespace()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing business object format file type.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, "I_DO_NOT_EXIST", FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing business object format file type.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("File type with code \"%s\" doesn't exist.", request.getBusinessObjectDataNotificationFilter().getBusinessObjectFormatFileType()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing storage name.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, "I_DO_NOT_EXIST", BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing storage name.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Storage with name \"%s\" doesn't exist.", request.getBusinessObjectDataNotificationFilter().getStorageName()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing new business object data status.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, "I_DO_NOT_EXIST", BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing new business object data status.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Business object data status \"%s\" doesn't exist.", request.getBusinessObjectDataNotificationFilter().getNewBusinessObjectDataStatus()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing old business object data status.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, "I_DO_NOT_EXIST"), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing old business object data status.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Business object data status \"%s\" doesn't exist.", request.getBusinessObjectDataNotificationFilter().getOldBusinessObjectDataStatus()), e.getMessage());
    }
    // Try to create a business object data notification when using new and old business object data statuses that are the same (case-insensitive).
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS.toUpperCase(), BDATA_STATUS.toLowerCase()), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an IllegalArgumentException when using new and old business object data statuses that are the same");
    } catch (IllegalArgumentException e) {
        assertEquals("The new business object data status is the same as the old one.", e.getMessage());
    }
    // Try to create a business object data notification for business object data
    // registration notification event type with an old business object data status specified.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an IllegalArgumentException when old business object data status is specified " + "for a business object data registration notification event type.");
    } catch (IllegalArgumentException e) {
        assertEquals("The old business object data status cannot be specified with a business object data registration event type.", e.getMessage());
    }
    // Try to create a business object data notification using non-existing job definition.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), Arrays.asList(new JobAction(NAMESPACE, "I_DO_NOT_EXIST", CORRELATION_DATA)), NotificationRegistrationStatusEntity.ENABLED);
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing job definition.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Job definition with namespace \"%s\" and job name \"%s\" doesn't exist.", request.getJobActions().get(0).getNamespace(), request.getJobActions().get(0).getJobName()), e.getMessage());
    }
    // Try to create a business object data notification using non-existing notification registration status.
    request = new BusinessObjectDataNotificationRegistrationCreateRequest(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), "I_DO_NOT_EXIST");
    try {
        businessObjectDataNotificationRegistrationService.createBusinessObjectDataNotificationRegistration(request);
        fail("Should throw an ObjectNotFoundException when using non-existing notification registration status.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("The notification registration status \"%s\" doesn't exist.", request.getNotificationRegistrationStatus()), e.getMessage());
    }
}
Also used : JobAction(org.finra.herd.model.api.xml.JobAction) BusinessObjectDataNotificationRegistrationCreateRequest(org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistrationCreateRequest) BusinessObjectDataNotificationFilter(org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 15 with ObjectNotFoundException

use of org.finra.herd.model.ObjectNotFoundException in project herd by FINRAOS.

the class BusinessObjectDataNotificationRegistrationServiceTest method testUpdateBusinessObjectDataNotificationRegistrationNoExists.

@Test
public void testUpdateBusinessObjectDataNotificationRegistrationNoExists() {
    // Try to update a non-existing business object data notification registration.
    try {
        businessObjectDataNotificationRegistrationService.updateBusinessObjectDataNotificationRegistration(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), new BusinessObjectDataNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, BDATA_STATUS, NO_BDATA_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.ENABLED));
        fail("Should throw an ObjectNotFoundException when trying to update a non-existing business object data notification.");
    } catch (ObjectNotFoundException e) {
        assertEquals(String.format("Business object data notification registration with name \"%s\" does not exist for \"%s\" namespace.", NOTIFICATION_NAME, NAMESPACE), e.getMessage());
    }
}
Also used : BusinessObjectDataNotificationFilter(org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) BusinessObjectDataNotificationRegistrationUpdateRequest(org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistrationUpdateRequest) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Aggregations

ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)216 Test (org.junit.Test)193 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)36 ArrayList (java.util.ArrayList)18 BusinessObjectDefinitionKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionKey)16 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)16 BusinessObjectDataAttributeKey (org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey)14 PartitionValueFilter (org.finra.herd.model.api.xml.PartitionValueFilter)12 TagKey (org.finra.herd.model.api.xml.TagKey)11 NotificationRegistrationKey (org.finra.herd.model.api.xml.NotificationRegistrationKey)10 StoragePolicyKey (org.finra.herd.model.api.xml.StoragePolicyKey)10 BusinessObjectDataDdlRequest (org.finra.herd.model.api.xml.BusinessObjectDataDdlRequest)9 StorageUnitEntity (org.finra.herd.model.jpa.StorageUnitEntity)8 InstanceDefinition (org.finra.herd.model.api.xml.InstanceDefinition)7 MasterInstanceDefinition (org.finra.herd.model.api.xml.MasterInstanceDefinition)7 AbstractDaoTest (org.finra.herd.dao.AbstractDaoTest)6 BusinessObjectDefinitionColumnKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey)6 BusinessObjectFormatKey (org.finra.herd.model.api.xml.BusinessObjectFormatKey)6 AmazonServiceException (com.amazonaws.AmazonServiceException)5 BusinessObjectData (org.finra.herd.model.api.xml.BusinessObjectData)5