test_class.declarator: emrClusterDefinitionDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private EmrClusterDefinitionDao emrClusterDefinitionDao;
test_class.type: EmrClusterDefinitionDao
test_class.var_name: emrClusterDefinitionDao
test_class.declarator: emrClusterDefinitionDaoHelper
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private EmrClusterDefinitionDaoHelper emrClusterDefinitionDaoHelper;
test_class.type: EmrClusterDefinitionDaoHelper
test_class.var_name: emrClusterDefinitionDaoHelper
test_class.declarator: namespaceDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NamespaceDao namespaceDao;
test_class.type: NamespaceDao
test_class.var_name: namespaceDao
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/EmrClusterDefinitionDaoHelperTest.java
test_class.identifier: EmrClusterDefinitionDaoHelperTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testGetEmrClusterDefinitionEntityNamespaceNoExists()
      {
          // Create an EMR cluster definition key.
          EmrClusterDefinitionKey emrClusterDefinitionKey = new EmrClusterDefinitionKey(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME);
  
          // Mock the external calls.
          when(namespaceDao.getNamespaceByCd(NAMESPACE)).thenReturn(null);
  
          // Try to call the method under test.
          try
          {
              emrClusterDefinitionDaoHelper.getEmrClusterDefinitionEntity(emrClusterDefinitionKey);
              fail();
          }
          catch (ObjectNotFoundException e)
          {
              assertEquals(String.format("EMR cluster definition with name \"%s\" doesn't exist for namespace \"%s\".", EMR_CLUSTER_DEFINITION_NAME, NAMESPACE),
                  e.getMessage());
          }
  
          // Verify the external calls.
          verify(namespaceDao).getNamespaceByCd(NAMESPACE);
          verifyNoMoreInteractionsHelper();
      }
test_case.class_method_signature: EmrClusterDefinitionDaoHelperTest.testGetEmrClusterDefinitionEntityNamespaceNoExists()
test_case.full_signature: @Test public void testGetEmrClusterDefinitionEntityNamespaceNoExists()
test_case.identifier: testGetEmrClusterDefinitionEntityNamespaceNoExists
test_case.invocations: thenReturn when getNamespaceByCd getEmrClusterDefinitionEntity fail assertEquals format getMessage getNamespaceByCd verify verifyNoMoreInteractionsHelper
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetEmrClusterDefinitionEntityNamespaceNoExists()
focal_class.declarator: emrClusterDefinitionDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private EmrClusterDefinitionDao emrClusterDefinitionDao;
focal_class.type: EmrClusterDefinitionDao
focal_class.var_name: emrClusterDefinitionDao
focal_class.declarator: namespaceDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private NamespaceDao namespaceDao;
focal_class.type: NamespaceDao
focal_class.var_name: namespaceDao
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/EmrClusterDefinitionDaoHelper.java
focal_class.identifier: EmrClusterDefinitionDaoHelper
focal_class.class_method_signature: EmrClusterDefinitionDaoHelper.getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_class.full_signature: public EmrClusterDefinitionEntity getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_class.identifier: getEmrClusterDefinitionEntity
focal_class.modifiers: public
focal_class.parameters: (EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_class.return: EmrClusterDefinitionEntity
focal_class.signature: EmrClusterDefinitionEntity getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_class.class_method_signature: EmrClusterDefinitionDaoHelper.getEmrClusterDefinitionKeys(String namespace)
focal_class.full_signature: public List<EmrClusterDefinitionKey> getEmrClusterDefinitionKeys(String namespace)
focal_class.identifier: getEmrClusterDefinitionKeys
focal_class.modifiers: public
focal_class.parameters: (String namespace)
focal_class.return: List<EmrClusterDefinitionKey>
focal_class.signature: List<EmrClusterDefinitionKey> getEmrClusterDefinitionKeys(String namespace)
focal_method.body: public EmrClusterDefinitionEntity getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey) throws ObjectNotFoundException
      {
          EmrClusterDefinitionEntity emrClusterDefinitionEntity = null;
  
          // Try to retrieve the relative namespace entity.
          NamespaceEntity namespaceEntity = namespaceDao.getNamespaceByCd(emrClusterDefinitionKey.getNamespace());
  
          // If namespace entity exists, try to retrieve EMR cluster definition entity by namespace entity and EMR cluster definition name.
          if (namespaceEntity != null)
          {
              emrClusterDefinitionEntity =
                  emrClusterDefinitionDao.getEmrClusterDefinitionByNamespaceAndName(namespaceEntity, emrClusterDefinitionKey.getEmrClusterDefinitionName());
          }
  
          // Throw an exception if EMR cluster definition entity does not exist.
          if (emrClusterDefinitionEntity == null)
          {
              throw new ObjectNotFoundException(String
                  .format("EMR cluster definition with name \"%s\" doesn't exist for namespace \"%s\".", emrClusterDefinitionKey.getEmrClusterDefinitionName(),
                      emrClusterDefinitionKey.getNamespace()));
          }
  
          return emrClusterDefinitionEntity;
      }
focal_method.class_method_signature: EmrClusterDefinitionDaoHelper.getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_method.full_signature: public EmrClusterDefinitionEntity getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_method.identifier: getEmrClusterDefinitionEntity
focal_method.invocations: getNamespaceByCd getNamespace getEmrClusterDefinitionByNamespaceAndName getEmrClusterDefinitionName format getEmrClusterDefinitionName getNamespace
focal_method.modifiers: public
focal_method.parameters: (EmrClusterDefinitionKey emrClusterDefinitionKey)
focal_method.return: EmrClusterDefinitionEntity
focal_method.signature: EmrClusterDefinitionEntity getEmrClusterDefinitionEntity(EmrClusterDefinitionKey emrClusterDefinitionKey)