Search in sources :

Example 6 with SMPParticipantMigration

use of com.helger.phoss.smp.domain.pmigration.SMPParticipantMigration in project phoss-smp by phax.

the class SMPParticipantMigrationManagerMongoDB method createOutboundParticipantMigration.

@Nonnull
public ISMPParticipantMigration createOutboundParticipantMigration(@Nonnull final IParticipantIdentifier aParticipantID, @Nonnull @Nonempty final String sMigrationKey) {
    final SMPParticipantMigration aSMPParticipantMigration = SMPParticipantMigration.createOutbound(aParticipantID, sMigrationKey);
    _createParticipantMigration(aSMPParticipantMigration);
    return aSMPParticipantMigration;
}
Also used : SMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.SMPParticipantMigration) ISMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigration) Nonnull(javax.annotation.Nonnull)

Example 7 with SMPParticipantMigration

use of com.helger.phoss.smp.domain.pmigration.SMPParticipantMigration in project phoss-smp by phax.

the class SMPParticipantMigrationManagerMongoDBTest method testConversion.

@Test
public void testConversion() {
    final SMPParticipantMigration a = SMPParticipantMigration.createInbound(new SimpleParticipantIdentifier("iso6523-actorid-upis", "9901:test"), "abc123");
    final Document d = SMPParticipantMigrationManagerMongoDB.toBson(a);
    assertNotNull(d);
    final SMPParticipantMigration a2 = SMPParticipantMigrationManagerMongoDB.toDomain(d);
    assertNotNull(a2);
    assertEquals(a, a2);
    assertEquals(d, SMPParticipantMigrationManagerMongoDB.toBson(a2));
}
Also used : SMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.SMPParticipantMigration) Document(org.bson.Document) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) Test(org.junit.Test)

Aggregations

SMPParticipantMigration (com.helger.phoss.smp.domain.pmigration.SMPParticipantMigration)7 ISMPParticipantMigration (com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigration)6 Nonnull (javax.annotation.Nonnull)4 Document (org.bson.Document)3 Wrapper (com.helger.commons.wrapper.Wrapper)2 ConstantPreparedStatementDataProvider (com.helger.db.jdbc.callback.ConstantPreparedStatementDataProvider)2 DBResultRow (com.helger.db.jdbc.executor.DBResultRow)2 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)2 EParticipantMigrationDirection (com.helger.phoss.smp.domain.pmigration.EParticipantMigrationDirection)2 EParticipantMigrationState (com.helger.phoss.smp.domain.pmigration.EParticipantMigrationState)2 Nullable (javax.annotation.Nullable)2 ReturnsMutableCopy (com.helger.commons.annotation.ReturnsMutableCopy)1 EChange (com.helger.commons.state.EChange)1 SimpleParticipantIdentifier (com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)1 LocalDateTime (java.time.LocalDateTime)1 Test (org.junit.Test)1