-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
703 additions
and
213 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
12 changes: 12 additions & 0 deletions
12
sdmx-dl-api/src/test/java/internal/sdmxdl/web/DefaultNetworkTest.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,12 @@ | ||
package internal.sdmxdl.web; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import tests.sdmxdl.web.spi.NetworkAssert; | ||
|
||
public class DefaultNetworkTest { | ||
|
||
@Test | ||
public void testCompliance() { | ||
NetworkAssert.assertCompliance(DefaultNetwork.INSTANCE); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
sdmx-dl-api/src/test/java/internal/sdmxdl/web/spi/DefaultNetworkingTest.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,12 @@ | ||
package internal.sdmxdl.web.spi; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import tests.sdmxdl.web.spi.NetworkingAssert; | ||
|
||
public class DefaultNetworkingTest { | ||
|
||
@Test | ||
public void testCompliance() { | ||
NetworkingAssert.assertCompliance(DefaultNetworking.INSTANCE); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
sdmx-dl-api/src/test/java/tests/sdmxdl/web/spi/NetworkAssert.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,22 @@ | ||
package tests.sdmxdl.web.spi; | ||
|
||
import lombok.NonNull; | ||
import sdmxdl.web.spi.Network; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@lombok.experimental.UtilityClass | ||
public class NetworkAssert { | ||
|
||
public static void assertCompliance(@NonNull Network x) { | ||
assertThat(x.getProxySelector()) | ||
.isNotNull(); | ||
|
||
assertThat(x.getSSLFactory()) | ||
.isNotNull() | ||
.satisfies(SSLFactoryAssert::assertCompliance); | ||
|
||
assertThat(x.getURLConnectionFactory()) | ||
.isNotNull(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
sdmx-dl-api/src/test/java/tests/sdmxdl/web/spi/NetworkingAssert.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,39 @@ | ||
package tests.sdmxdl.web.spi; | ||
|
||
import lombok.NonNull; | ||
import sdmxdl.web.SdmxWebSource; | ||
import sdmxdl.web.spi.Networking; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatNullPointerException; | ||
import static sdmxdl.web.spi.Networking.NETWORKING_PROPERTY_PREFIX; | ||
import static tests.sdmxdl.api.TckUtil.SCREAMING_SNAKE_CASE; | ||
import static tests.sdmxdl.api.TckUtil.startingWith; | ||
|
||
@lombok.experimental.UtilityClass | ||
public class NetworkingAssert { | ||
|
||
@SuppressWarnings("DataFlowIssue") | ||
public static void assertCompliance(@NonNull Networking x) { | ||
assertThat(x.getNetworkingId()) | ||
.containsPattern(SCREAMING_SNAKE_CASE); | ||
|
||
assertThat(x.getNetworkingProperties()) | ||
.are(startingWith(NETWORKING_PROPERTY_PREFIX)) | ||
.doesNotHaveDuplicates(); | ||
|
||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.getNetwork(null, null, null)); | ||
|
||
SdmxWebSource validSource = SdmxWebSource | ||
.builder() | ||
.id("valid") | ||
.driver("SDMX21") | ||
.endpointOf("http://localhost") | ||
.build(); | ||
|
||
assertThat(x.getNetwork(validSource, null, null)) | ||
.isNotNull() | ||
.satisfies(NetworkAssert::assertCompliance); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
sdmx-dl-api/src/test/java/tests/sdmxdl/web/spi/SSLFactoryAssert.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,18 @@ | ||
package tests.sdmxdl.web.spi; | ||
|
||
import lombok.NonNull; | ||
import sdmxdl.web.spi.SSLFactory; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@lombok.experimental.UtilityClass | ||
public class SSLFactoryAssert { | ||
|
||
public static void assertCompliance(@NonNull SSLFactory x) { | ||
assertThat(x.getSSLSocketFactory()) | ||
.isNotNull(); | ||
|
||
assertThat(x.getHostnameVerifier()) | ||
.isNotNull(); | ||
} | ||
} |
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
Oops, something went wrong.