Skip to content

Commit

Permalink
Trying to fix troubles with test
Browse files Browse the repository at this point in the history
  • Loading branch information
5h15h4k1n9 committed Apr 21, 2023
1 parent 27dc233 commit 3a92f2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/trik/testsys/gradingsystem/enums/Paths.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package trik.testsys.gradingsystem.enums

enum class Paths(val text: String) {

SUBMISSIONS("/submissions/"),
TASKS("/tasks/"),
SUBMISSIONS("./submissions/"),
TASKS("./tasks/"),
TESTS("tests/"),
PIN("pin.txt"),
RESULTS("results/")
Expand Down
5 changes: 3 additions & 2 deletions src/test/kotlin/controller/SubmissionControllerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class SubmissionControllerTest {

@Test
fun `postSubmission should return json with info about uploaded submission`() {
File("/submissions").mkdir()
File("./submissions").mkdir()
val file = File("src/test/resources/test_files/post_submission_test_files/qrs-file.qrs")
val multipartFile = MockMultipartFile("file", file.name, "text/plain", file.readBytes())

Expand All @@ -502,6 +502,7 @@ class SubmissionControllerTest {
.param("task_name", submission.taskName)
.param("student_id", submission.studentId)
)
.andExpect(status().isOk)
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(jsonPath("\$").isNotEmpty)

Expand All @@ -511,7 +512,7 @@ class SubmissionControllerTest {
.andExpect(jsonPath("\$.task_name").value(submission.taskName))
.andExpect(jsonPath("\$.date").value(submission.date))

File("/submissions").deleteRecursively()
File("./submissions").deleteRecursively()
}
}

Expand Down

0 comments on commit 3a92f2f

Please sign in to comment.