Fixed errors in tests for sql injection introduction 10
This commit is contained in:
parent
3883563c7d
commit
e859c9c37b
@ -42,7 +42,7 @@ public class SqlInjectionLesson10Test extends LessonTest {
|
|||||||
public void tableExistsIsFailure() throws Exception {
|
public void tableExistsIsFailure() throws Exception {
|
||||||
try {
|
try {
|
||||||
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
||||||
.param("action", ""))
|
.param("action_string", ""))
|
||||||
|
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("lessonCompleted", is(false)))
|
.andExpect(jsonPath("lessonCompleted", is(false)))
|
||||||
@ -51,7 +51,7 @@ public class SqlInjectionLesson10Test extends LessonTest {
|
|||||||
if (!e.getMessage().contains(completedError)) throw e;
|
if (!e.getMessage().contains(completedError)) throw e;
|
||||||
|
|
||||||
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
||||||
.param("action", ""))
|
.param("action_string", ""))
|
||||||
|
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("lessonCompleted", is(true)))
|
.andExpect(jsonPath("lessonCompleted", is(true)))
|
||||||
@ -62,7 +62,7 @@ public class SqlInjectionLesson10Test extends LessonTest {
|
|||||||
@Test
|
@Test
|
||||||
public void tableMissingIsSuccess() throws Exception {
|
public void tableMissingIsSuccess() throws Exception {
|
||||||
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack10")
|
||||||
.param("action", "%'; DROP TABLE access_log;--"))
|
.param("action_string", "%'; DROP TABLE access_log;--"))
|
||||||
|
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("lessonCompleted", is(true)))
|
.andExpect(jsonPath("lessonCompleted", is(true)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user