Skip to content

Commit

Permalink
#26002 Using fail fast flag in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgambarios committed Sep 21, 2023
1 parent 9f7fd75 commit e68c9ef
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Test_Command_Language_Pull_By_IsoCode_Checking_JSON_DotCMS_Type() throws IO

// And now pushing the language back to dotCMS to make sure the structure is still correct
status = commandLine.execute(LanguageCommand.NAME, LanguagePush.NAME,
languageFilePath.toAbsolutePath().toString());
languageFilePath.toAbsolutePath().toString(), "-ff");
Assertions.assertEquals(CommandLine.ExitCode.OK, status);
} finally {
deleteTempDirectory(tempFolder);
Expand Down Expand Up @@ -172,7 +172,7 @@ void Test_Command_Language_Pull_By_IsoCode_Checking_YAML_DotCMS_Type() throws IO

// And now pushing the language back to dotCMS to make sure the structure is still correct
status = commandLine.execute(LanguageCommand.NAME, LanguagePush.NAME,
languageFilePath.toAbsolutePath().toString());
languageFilePath.toAbsolutePath().toString(), "-ff");
Assertions.assertEquals(CommandLine.ExitCode.OK, status);
} finally {
deleteTempDirectory(tempFolder);
Expand Down Expand Up @@ -258,7 +258,7 @@ void Test_Command_Language_Push_byFile_JSON() throws IOException {
mapper.writeValue(targetFilePath.toFile(), language);
commandLine.setOut(out);
final int status = commandLine.execute(LanguageCommand.NAME, LanguagePush.NAME,
targetFilePath.toAbsolutePath().toString());
targetFilePath.toAbsolutePath().toString(), "-ff");
Assertions.assertEquals(CommandLine.ExitCode.OK, status);

// Checking we pushed the language correctly
Expand All @@ -268,6 +268,15 @@ void Test_Command_Language_Push_byFile_JSON() throws IOException {
Assertions.assertNotNull(foundLanguage.entity());
Assertions.assertTrue(foundLanguage.entity().language().isPresent());
Assertions.assertEquals("Italian", foundLanguage.entity().language().get());

// Cleaning up
try {
clientFactory.getClient(LanguageAPI.class).delete(
String.valueOf(foundLanguage.entity().id().get())
);
} catch (Exception e) {
// Ignoring
}
}
}

Expand Down Expand Up @@ -296,7 +305,7 @@ void Test_Command_Language_Push_byFile_YAML() throws IOException {
mapper.writeValue(targetFilePath.toFile(), language);
commandLine.setOut(out);
int status = commandLine.execute(LanguageCommand.NAME, LanguagePush.NAME,
targetFilePath.toAbsolutePath().toString());
targetFilePath.toAbsolutePath().toString(), "-ff");
Assertions.assertEquals(CommandLine.ExitCode.OK, status);

// Checking we pushed the language correctly
Expand All @@ -306,6 +315,15 @@ void Test_Command_Language_Push_byFile_YAML() throws IOException {
Assertions.assertNotNull(foundLanguage.entity());
Assertions.assertTrue(foundLanguage.entity().language().isPresent());
Assertions.assertEquals("Italian", foundLanguage.entity().language().get());

// Cleaning up
try {
clientFactory.getClient(LanguageAPI.class).delete(
String.valueOf(foundLanguage.entity().id().get())
);
} catch (Exception e) {
// Ignoring
}
}
}

Expand Down

0 comments on commit e68c9ef

Please sign in to comment.