@@ -95,10 +95,15 @@ void testGetModel() throws ModelResolutionException {
9595 assertTrue ( result .filename ().get ().contains ( "Movement.ttl" ) );
9696 }
9797
98+ @ Test
99+ void testCheckElementExists () throws ModelResolutionException {
100+ assertTrue ( modelService .checkElementExists ( NAMESPACE .withName ( TEST_MODEL_FOR_SERVICE ), "Example.ttl" ) );
101+ assertFalse ( modelService .checkElementExists ( NAMESPACE .withName ( TEST_MODEL_FOR_SERVICE ), "Movement.ttl" ) );
102+ }
103+
98104 @ Test ()
99105 void testGetModelThrowsNotFoundException () {
100- assertThrows ( FileNotFoundException .class , () ->
101- modelService .getModel ( NAMESPACE .withName ( TEST_MODEL_NOT_FOUND ), TEST_FILEPATH ) );
106+ assertThrows ( FileNotFoundException .class , () -> modelService .getModel ( NAMESPACE .withName ( TEST_MODEL_NOT_FOUND ), TEST_FILEPATH ) );
102107 }
103108
104109 @ Test
@@ -120,8 +125,8 @@ void testSaveModel() {
120125 final Path fileToReplace = Path .of ( TEST_NAMESPACE_PATH .toString (), TEST_MODEL_FOR_SERVICE + FILE_EXTENSION );
121126 final String turtleData = Files .readString ( fileToReplace , StandardCharsets .UTF_8 );
122127
123- modelService .createOrSaveModel ( turtleData , NAMESPACE .withName ( TEST_MODEL_FOR_SERVICE ),
124- TEST_MODEL_FOR_SERVICE + FILE_EXTENSION , RESOURCE_PATH .toAbsolutePath () );
128+ modelService .createOrSaveModel ( turtleData , NAMESPACE .withName ( TEST_MODEL_FOR_SERVICE ), TEST_MODEL_FOR_SERVICE + FILE_EXTENSION ,
129+ RESOURCE_PATH .toAbsolutePath () );
125130 } );
126131 }
127132
@@ -194,15 +199,14 @@ void testMigrateWorkspaceWithoutVersionUpgrade() throws IOException {
194199
195200 assertTrue ( migrationResult .success () );
196201
197- final String migratedModelOne = Files .readString ( new File ( MIGRATE_WORKSPACE_ONE + File .separator + "ToMigrateOne.ttl" ).toPath ()
198- .toAbsolutePath (),
199- StandardCharsets .UTF_8 );
202+ final String migratedModelOne = Files .readString (
203+ new File ( MIGRATE_WORKSPACE_ONE + File .separator + "ToMigrateOne.ttl" ).toPath ().toAbsolutePath (), StandardCharsets .UTF_8 );
200204 final String migratedModelTwo = Files .readString ( new File ( MIGRATE_WORKSPACE_ONE + File .separator + "ToMigrateTwo.ttl" ).toPath (),
201205 StandardCharsets .UTF_8 );
202- final String migratedModelThree = Files .readString (
203- new File ( MIGRATE_WORKSPACE_TWO + File . separator + "ToMigrateOne.ttl" ). toPath (), StandardCharsets .UTF_8 );
204- final String migratedModelFour = Files .readString (
205- new File ( MIGRATE_WORKSPACE_TWO + File . separator + "ToMigrateTwo.ttl" ). toPath (), StandardCharsets .UTF_8 );
206+ final String migratedModelThree = Files .readString ( new File ( MIGRATE_WORKSPACE_TWO + File . separator + "ToMigrateOne.ttl" ). toPath (),
207+ StandardCharsets .UTF_8 );
208+ final String migratedModelFour = Files .readString ( new File ( MIGRATE_WORKSPACE_TWO + File . separator + "ToMigrateTwo.ttl" ). toPath (),
209+ StandardCharsets .UTF_8 );
206210
207211 checkMigratedModel ( migratedModelOne );
208212 checkMigratedModel ( migratedModelTwo );
@@ -217,12 +221,10 @@ void testMigrateWorkspaceWithVersionUpgrade() throws IOException {
217221 assertTrue ( migrationResult .success () );
218222
219223 final String migratedModelOne = Files .readString (
220- new File ( MIGRATE_WORKSPACE_ONE_NEW_VERSION + File .separator + "ToMigrateOne.ttl" ).toPath ()
221- .toAbsolutePath (),
224+ new File ( MIGRATE_WORKSPACE_ONE_NEW_VERSION + File .separator + "ToMigrateOne.ttl" ).toPath ().toAbsolutePath (),
222225 StandardCharsets .UTF_8 );
223226 final String migratedModelTwo = Files .readString (
224- new File ( MIGRATE_WORKSPACE_ONE_NEW_VERSION + File .separator + "ToMigrateTwo.ttl" ).toPath (),
225- StandardCharsets .UTF_8 );
227+ new File ( MIGRATE_WORKSPACE_ONE_NEW_VERSION + File .separator + "ToMigrateTwo.ttl" ).toPath (), StandardCharsets .UTF_8 );
226228 final String migratedModelThree = Files .readString (
227229 new File ( MIGRATE_WORKSPACE_TWO_NEW_VERSION + File .separator + "ToMigrateOne.ttl" ).toPath (), StandardCharsets .UTF_8 );
228230 final String migratedModelFour = Files .readString (
0 commit comments