BusinessObjectDefinitionHelper { public void validateBusinessObjectDefinitionKey(BusinessObjectDefinitionKey key) throws IllegalArgumentException { Assert.notNull(key, "A business object definition key must be specified."); key.setNamespace(alternateKeyHelper.validateStringParameter("namespace", key.getNamespace())); key.setBusinessObjectDefinitionName( alternateKeyHelper.validateStringParameter("business object definition name", key.getBusinessObjectDefinitionName())); }  String businessObjectDefinitionKeyToString(BusinessObjectDefinitionKey businessObjectDefinitionKey); void executeFunctionForBusinessObjectDefinitionEntities(final String indexName,
        final List<BusinessObjectDefinitionEntity> businessObjectDefinitionEntities, final TriConsumer<String, String, String> function); BusinessObjectDefinitionKey getBusinessObjectDefinitionKey(BusinessObjectDefinitionColumnKey businessObjectDefinitionColumnKey); void validateBusinessObjectDefinitionKey(BusinessObjectDefinitionKey key); String safeObjectMapperWriteValueAsString(final BusinessObjectDefinitionEntity businessObjectDefinitionEntity); void processTagSearchScoreMultiplier(final BusinessObjectDefinitionEntity businessObjectDefinitionEntity);  }
@Test public void testValidateBusinessObjectDefinitionKey() { BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME); when(alternateKeyHelper.validateStringParameter("namespace", BDEF_NAMESPACE)).thenReturn(BDEF_NAMESPACE); when(alternateKeyHelper.validateStringParameter("business object definition name", BDEF_NAME)).thenReturn(BDEF_NAME); businessObjectDefinitionHelper.validateBusinessObjectDefinitionKey(businessObjectDefinitionKey); verify(alternateKeyHelper).validateStringParameter("namespace", BDEF_NAMESPACE); verify(alternateKeyHelper).validateStringParameter("business object definition name", BDEF_NAME); verifyNoMoreInteractions(alternateKeyHelper, jsonHelper); assertEquals(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), businessObjectDefinitionKey); }
@Test public void testValidateBusinessObjectDefinitionKeyBusinessObjectDefinitionKeyIsNull() { try { businessObjectDefinitionHelper.validateBusinessObjectDefinitionKey(null); fail(); } catch (IllegalArgumentException e) { assertEquals("A business object definition key must be specified.", e.getMessage()); } }