Search in sources :

Example 6 with ParticipantIdentifierType

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());
}
Also used : ParticipantIdentifierPageType(com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType) ServiceMetadataPublisherServiceForParticipantType(com.helger.peppol.smlclient.participant.ServiceMetadataPublisherServiceForParticipantType) ParticipantIdentifierType(com.helger.xsds.peppol.id1.ParticipantIdentifierType) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Example 7 with ParticipantIdentifierType

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());
}
Also used : ParticipantIdentifierPageType(com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType) ParticipantIdentifierType(com.helger.xsds.peppol.id1.ParticipantIdentifierType) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Aggregations

ParticipantIdentifierType (com.helger.xsds.peppol.id1.ParticipantIdentifierType)7 ParticipantIdentifierPageType (com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType)6 Test (org.junit.Test)6 ManageParticipantIdentifierServiceCaller (com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller)5 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)5 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 ServiceMetadataPublisherServiceForParticipantType (com.helger.peppol.smlclient.participant.ServiceMetadataPublisherServiceForParticipantType)2 SimpleParticipantIdentifier (com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)2 CommonsHashMap (com.helger.commons.collection.impl.CommonsHashMap)1 CompleteServiceGroupType (com.helger.xsds.peppol.smp1.CompleteServiceGroupType)1 ServiceGroupType (com.helger.xsds.peppol.smp1.ServiceGroupType)1