use of com.helger.xsds.peppol.id1.ParticipantIdentifierType in project peppol-commons by phax.
the class SMLFuncTest method testManageBusinessIdentifier.
@Test
public void testManageBusinessIdentifier() throws Exception {
final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
final IParticipantIdentifier aBusinessIdentifierCreate = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme(TEST_BUSINESS_IDENTIFIER1);
final ServiceMetadataPublisherServiceForParticipantType saSrviceMetadataPublisherServiceForBusiness = new ServiceMetadataPublisherServiceForParticipantType();
// Explicit constructor call needed for type conversion
saSrviceMetadataPublisherServiceForBusiness.setParticipantIdentifier(new SimpleParticipantIdentifier(aBusinessIdentifierCreate));
saSrviceMetadataPublisherServiceForBusiness.setServiceMetadataPublisherID(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
aPIClient.create(saSrviceMetadataPublisherServiceForBusiness);
final ParticipantIdentifierPageType aResult = aPIClient.list("", m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
assertNotNull(aResult);
final List<ParticipantIdentifierType> aBusinessIdentifiers = aResult.getParticipantIdentifier();
assertEquals(1, aBusinessIdentifiers.size());
final ParticipantIdentifierType aBusinessIdentifierRead = aBusinessIdentifiers.get(0);
assertEquals(aBusinessIdentifierCreate.getScheme(), aBusinessIdentifierRead.getScheme());
assertEquals(aBusinessIdentifierCreate.getValue(), aBusinessIdentifierRead.getValue());
aPIClient.deleteList(aBusinessIdentifiers);
m_aSMClient.delete(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
}
use of com.helger.xsds.peppol.id1.ParticipantIdentifierType in project peppol-commons by phax.
the class SMLFuncTest method testManageBusinessIdentifierListWithZeroElements.
@Test
public void testManageBusinessIdentifierListWithZeroElements() throws Exception {
final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
final ICommonsList<IParticipantIdentifier> aRecipientBusinessIdentifiers = new CommonsArrayList<>();
aPIClient.createList(aRecipientBusinessIdentifiers, SMP_ID);
final ParticipantIdentifierPageType aResult = aPIClient.list("", m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
assertNotNull(aResult);
final List<ParticipantIdentifierType> aBusinessIdentifiers = aResult.getParticipantIdentifier();
assertEquals(0, aBusinessIdentifiers.size());
m_aSMClient.delete(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
}
Aggregations