-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add contractId to EndpointDataReference
- Loading branch information
1 parent
12f1275
commit 89c3261
Showing
8 changed files
with
134 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ore-spi/src/test/java/org/eclipse/edc/spi/types/domain/edr/EndpointDataReferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2023 Amadeus | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Amadeus - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.spi.types.domain.edr; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThatNoException; | ||
import static org.assertj.core.api.Assertions.assertThatNullPointerException; | ||
|
||
class EndpointDataReferenceTest { | ||
|
||
@Test | ||
void buildMinimalEdr() { | ||
assertThatNoException().isThrownBy(() -> EndpointDataReference.Builder.newInstance() | ||
.endpoint("http://foo.bar") | ||
.id("id") | ||
.contractId("contractId") | ||
.build()); | ||
} | ||
|
||
@Test | ||
void buildEdrWithAuth() { | ||
assertThatNoException().isThrownBy(() -> EndpointDataReference.Builder.newInstance() | ||
.endpoint("http://foo.bar") | ||
.authKey("authKey") | ||
.authCode("authCode") | ||
.id("id") | ||
.contractId("contractId") | ||
.build()); | ||
} | ||
|
||
@Test | ||
void assertIdMandatory() { | ||
assertThatNullPointerException().isThrownBy(() -> EndpointDataReference.Builder.newInstance() | ||
.endpoint("http://foo.bar") | ||
.contractId("contractId") | ||
.build()) | ||
.withMessageContaining("id"); | ||
} | ||
|
||
@Test | ||
void assertContractIdMandatory() { | ||
assertThatNullPointerException().isThrownBy(() -> EndpointDataReference.Builder.newInstance() | ||
.endpoint("http://foo.bar") | ||
.id("id") | ||
.build()) | ||
.withMessageContaining("contractId"); | ||
} | ||
} |