*/
@Test
public void registerBusiness() throws Throwable
{
//Get an Authentication Token.
GetAuthenticationToken getAuthenticationToken = new GetAuthenticationToken();
getAuthenticationToken.run();
//Generate a unique business name including a pseudo random uuid.
String uniqueBusinessName = "business no " + UUID.randomUUID().toString();
//Save business under generated name using Auth token.
RegisterBusiness registerBusiness = new RegisterBusiness(getAuthenticationToken.getAuthenticationToken(), uniqueBusinessName);
registerBusiness.run();
//Retrieve business key and name from returned BusinessDetail object. The key, given
//by jUUDI, will be submitted while publishing services under the business. The name
//is used to generate the services access point and later to verify that jUDDI can
//find the business again.
String businesskey = registerBusiness.getBusinessDetail().getBusinessEntity().get(0).getBusinessKey();
String businessName = registerBusiness.getBusinessDetail().getBusinessEntity().get(0).getName().get(0).getValue();
//Publish a single services under the new business.
RegisterService registerService = new RegisterService(
getAuthenticationToken.getAuthenticationToken(), businesskey, businessName);
registerService.run();
//Find all businesses. This should return a SOAP message with a list of all businesses.
FindBusinessByName findBusinessByName = new FindBusinessByName(getAuthenticationToken.getAuthenticationToken(),
"%");
findBusinessByName.run();
}