Skip to content

Commit 73c6719

Browse files
committed
Revert to previous approach
1 parent 5d2e814 commit 73c6719

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGeneratorTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,21 @@ class AasToAspectModelGeneratorTest {
4040

4141
@Test
4242
void testTranslateDigitalNameplate() {
43-
final InputStream aasx = getIdtaModel(
44-
"ZVEI_Digital_Nameplate/1/0/Sample_ZVEI_Digital_Nameplate_V10.aasx" );
43+
final InputStream aasx = AasToAspectModelGeneratorTest.class.getClassLoader()
44+
.getResourceAsStream( "idta/Sample_ZVEI_Digital_Nameplate_V10.aasx" );
4545
final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromAasx( aasx );
4646
assertThatCode( aspectModelGenerator::generateAspects ).doesNotThrowAnyException();
4747
}
4848

4949
@Test
5050
void testSeeReferences() {
51-
final InputStream inputStream = getIdtaModel(
52-
"Wireless Communication/1/0/IDTA 02022-1-0_Template_Wireless Communication.aasx" );
51+
final InputStream inputStream = AasToAspectModelGeneratorTest.class.getClassLoader().getResourceAsStream(
52+
"idta/IDTA 02022-1-0_Template_Wireless Communication.aasx" );
5353
final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromAasx( inputStream );
5454
final List<Aspect> aspects = aspectModelGenerator.generateAspects();
5555

56+
assertThatCode( aspectModelGenerator::generateAspects ).doesNotThrowAnyException();
57+
5658
aspects.stream()
5759
.flatMap( aspect -> aspect.getProperties().stream() )
5860
.flatMap( property -> property.getSee().stream() )
@@ -151,7 +153,8 @@ private Environment loadEnvironment( final String name ) {
151153

152154
private InputStream getIdtaModel( final String path ) {
153155
try {
154-
final URL url = new URL( "https://github.com/admin-shell-io/submodel-templates/raw/refs/heads/main/published/" + path.replaceAll( " ", "%20" ) );
156+
final URL url = new URL(
157+
"https://github.com/admin-shell-io/submodel-templates/raw/refs/heads/main/published/" + path.replaceAll( " ", "%20" ) );
155158
return url.openStream();
156159
} catch ( Exception e ) {
157160
e.printStackTrace();
9.11 KB
Binary file not shown.
7.66 KB
Binary file not shown.

0 commit comments

Comments
 (0)