96134<\\/td> | Bob<\\/td> | Franco<\\/td> | Marketing<\\/td> | 83700<\\/td> | LO9S2V<\\/td><\\/tr>")));
}
@@ -66,7 +66,7 @@ public class SqlInjectionLesson8Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
+ .andExpect(jsonPath("$.feedback", is(modifySpan(messages.getMessage("sql-injection.8.no.results")))))
.andExpect(jsonPath("$.output").doesNotExist());
}
@@ -78,7 +78,7 @@ public class SqlInjectionLesson8Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
+ .andExpect(jsonPath("$.feedback", is(modifySpan(messages.getMessage("sql-injection.8.no.results")))))
.andExpect(jsonPath("$.output").doesNotExist());
}
@@ -90,11 +90,11 @@ public class SqlInjectionLesson8Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.error")))))
+ .andExpect(jsonPath("$.feedback", is(modifySpan(messages.getMessage("sql-injection.error")))))
.andExpect(jsonPath("$.output", containsString("feedback-negative")));
}
- private String modifySpan(String message) {
+ public static String modifySpan(String message) {
return message.replace("", "<\\/span>");
}
-}
+}
\ No newline at end of file
diff --git a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson9Test.java b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson9Test.java
index 5e81a26b7..d39420dbd 100644
--- a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson9Test.java
+++ b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson9Test.java
@@ -45,7 +45,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.one")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.one")))))
.andExpect(jsonPath("$.output", containsString("")));
} catch (AssertionError e) {
if (!e.getMessage().contains(completedError)) throw e;
@@ -56,7 +56,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.success")))))
.andExpect(jsonPath("$.output", containsString("")));
}
}
@@ -70,7 +70,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.one")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.one")))))
.andExpect(jsonPath("$.output", containsString(" |
---|
96134<\\/td> | Bob<\\/td> | Franco<\\/td> | Marketing<\\/td> | 83700<\\/td> | LO9S2V<\\/td><\\/tr>")));
} catch (AssertionError e) {
if (!e.getMessage().contains(completedError)) throw e;
@@ -81,7 +81,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.success")))))
.andExpect(jsonPath("$.output", containsString(" | 96134<\\/td> | Bob<\\/td> | Franco<\\/td> | Marketing<\\/td> | 83700<\\/td> | LO9S2V<\\/td><\\/tr>")));
}
}
@@ -95,7 +95,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
.andExpect(jsonPath("$.output").doesNotExist());
} catch (AssertionError e) {
if (!e.getMessage().contains(completedError)) throw e;
@@ -106,7 +106,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.8.no.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.8.no.success")))))
.andExpect(jsonPath("$.output").doesNotExist());
}
}
@@ -120,7 +120,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.8.no.results")))))
.andExpect(jsonPath("$.output").doesNotExist());
} catch (AssertionError e) {
if (!e.getMessage().contains(completedError)) throw e;
@@ -131,7 +131,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.success")))))
.andExpect(jsonPath("$.output").doesNotExist());
}
}
@@ -145,7 +145,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(false)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.error")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.error")))))
.andExpect(jsonPath("$.output", containsString("feedback-negative")));
} catch (AssertionError e) {
if (!e.getMessage().contains(completedError)) throw e;
@@ -156,7 +156,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.success")))))
.andExpect(jsonPath("$.output", containsString("feedback-negative")));
}
}
@@ -169,11 +169,7 @@ public class SqlInjectionLesson9Test extends LessonTest {
.andExpect(status().isOk())
.andExpect(jsonPath("lessonCompleted", is(true)))
- .andExpect(jsonPath("$.feedback", is(this.modifySpan(messages.getMessage("sql-injection.9.success")))))
+ .andExpect(jsonPath("$.feedback", is(SqlInjectionLesson8Test.modifySpan(messages.getMessage("sql-injection.9.success")))))
.andExpect(jsonPath("$.output", containsString("300000")));
}
-
- private String modifySpan(String message) {
- return message.replace("", "<\\/span>");
- }
}
\ No newline at end of file
|
|
---|
|