|
| 1 | +/* |
| 2 | + * Copyright (C) 2015-2026 Philip Helger and contributors |
| 3 | + * philip[at]helger[dot]com |
| 4 | + * |
| 5 | + * The Original Code is Copyright The Peppol project (http://www.peppol.eu) |
| 6 | + * |
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public |
| 8 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 9 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 10 | + */ |
| 11 | +package com.helger.phoss.smp.domain.serviceinfo; |
| 12 | + |
| 13 | +import static org.junit.Assert.assertEquals; |
| 14 | + |
| 15 | +import org.junit.Test; |
| 16 | + |
| 17 | +import com.helger.peppolid.peppol.PeppolIdentifierHelper; |
| 18 | +import com.helger.peppolid.simple.process.SimpleProcessIdentifier; |
| 19 | + |
| 20 | +/** |
| 21 | + * Test class for {@link SMPProcess#getEndpointCount()}. |
| 22 | + * |
| 23 | + * @author Greg Taube |
| 24 | + */ |
| 25 | +public final class SMPProcessEndpointCountTest |
| 26 | +{ |
| 27 | + private static SMPEndpoint _createEndpoint (final String sID, final String sTransportProfile) |
| 28 | + { |
| 29 | + return new SMPEndpoint (sID, |
| 30 | + sTransportProfile, |
| 31 | + "http://localhost/as2", |
| 32 | + false, |
| 33 | + null, |
| 34 | + null, |
| 35 | + null, |
| 36 | + "cert", |
| 37 | + "description", |
| 38 | + "https://example.org/contact", |
| 39 | + null, |
| 40 | + null); |
| 41 | + } |
| 42 | + |
| 43 | + @Test |
| 44 | + public void testMultipleEndpointsPerTransportProfile () |
| 45 | + { |
| 46 | + final SMPProcess aProcess = new SMPProcess (new SimpleProcessIdentifier (PeppolIdentifierHelper.DEFAULT_PROCESS_SCHEME, |
| 47 | + "test-process"), |
| 48 | + null, |
| 49 | + null); |
| 50 | + aProcess.addEndpoint (_createEndpoint ("endpoint-1", "transport-profile-1")); |
| 51 | + aProcess.addEndpoint (_createEndpoint ("endpoint-2", "transport-profile-1")); |
| 52 | + aProcess.addEndpoint (_createEndpoint ("endpoint-3", "transport-profile-2")); |
| 53 | + |
| 54 | + assertEquals (3, aProcess.getEndpointCount ()); |
| 55 | + } |
| 56 | +} |
0 commit comments