Skip to content

Commit 609e062

Browse files
committed
Update ModelServiceTest.java
1 parent 0d024a2 commit 609e062

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

aspect-model-editor-service/src/test/java/org/eclipse/esmf/ame/services/ModelServiceTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import org.eclipse.esmf.ame.exceptions.FileNotFoundException;
2929
import org.eclipse.esmf.ame.model.MockFileUpload;
30+
import org.eclipse.esmf.ame.services.models.AspectModelResult;
3031
import org.eclipse.esmf.ame.services.models.MigrationResult;
3132
import org.eclipse.esmf.ame.validation.model.ViolationReport;
3233
import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader;
@@ -84,13 +85,14 @@ void testDeleteModel() {
8485

8586
@Test
8687
void testGetModel() throws ModelResolutionException {
87-
final String result = modelService.getModel( NAMESPACE.withName( TEST_MODEL_FOR_SERVICE ), TEST_FILEPATH )._2;
88-
assertTrue( result.contains( "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> ." ) );
89-
assertTrue( result.contains( "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ." ) );
90-
assertTrue( result.contains( "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> ." ) );
91-
assertTrue( result.contains( "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> ." ) );
92-
assertTrue( result.contains( "@prefix : <urn:samm:org.eclipse.esmf.example:1.0.0#> ." ) );
93-
assertTrue( result.contains( ":Movement a samm:Aspect ;" ) );
88+
final AspectModelResult result = modelService.getModel( NAMESPACE.withName( TEST_MODEL_FOR_SERVICE ), TEST_FILEPATH );
89+
assertTrue( result.content().contains( "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> ." ) );
90+
assertTrue( result.content().contains( "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ." ) );
91+
assertTrue( result.content().contains( "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> ." ) );
92+
assertTrue( result.content().contains( "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> ." ) );
93+
assertTrue( result.content().contains( "@prefix : <urn:samm:org.eclipse.esmf.example:1.0.0#> ." ) );
94+
assertTrue( result.content().contains( ":Movement a samm:Aspect ;" ) );
95+
assertTrue( result.filename().get().contains( "Movement.ttl" ) );
9496
}
9597

9698
@Test()
@@ -190,7 +192,7 @@ public Path modelPath() {
190192
void testMigrateWorkspaceWithoutVersionUpgrade() throws IOException {
191193
final MigrationResult migrationResult = modelService.migrateWorkspace( false, MIGRATION_WORKSPACE_PATH );
192194

193-
assertTrue( migrationResult.isSuccess() );
195+
assertTrue( migrationResult.success() );
194196

195197
final String migratedModelOne = Files.readString( new File( MIGRATE_WORKSPACE_ONE + File.separator + "ToMigrateOne.ttl" ).toPath()
196198
.toAbsolutePath(),
@@ -212,7 +214,7 @@ void testMigrateWorkspaceWithoutVersionUpgrade() throws IOException {
212214
void testMigrateWorkspaceWithVersionUpgrade() throws IOException {
213215
final MigrationResult migrationResult = modelService.migrateWorkspace( true, MIGRATION_WORKSPACE_PATH );
214216

215-
assertTrue( migrationResult.isSuccess() );
217+
assertTrue( migrationResult.success() );
216218

217219
final String migratedModelOne = Files.readString(
218220
new File( MIGRATE_WORKSPACE_ONE_NEW_VERSION + File.separator + "ToMigrateOne.ttl" ).toPath()

0 commit comments

Comments
 (0)