This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from SELab-2/development
Last last last PR?
- Loading branch information
Showing
2 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ import org.springframework.web.context.request.ServletRequestAttributes | |
import java.util.UUID | ||
|
||
class ProjectServiceTests { | ||
private val scheme = System.getenv("OSOC_SCHEME") ?: "http" | ||
private val testId = UUID.randomUUID() | ||
private val testStudent = Student("Lars", "Van Cauter", "") | ||
private val testCoach = User("Lars2 Van Cauter", "[email protected]", Role.Coach, "password") | ||
|
@@ -219,27 +220,27 @@ class ProjectServiceTests { | |
val service = ProjectService(repository, mockk(), getUserService()) | ||
|
||
val mockRequest = MockHttpServletRequest() | ||
mockRequest.scheme = "http" | ||
mockRequest.scheme = scheme | ||
mockRequest.serverName = "example.com" | ||
mockRequest.serverPort = -1 | ||
mockRequest.contextPath = "/api" | ||
RequestContextHolder.setRequestAttributes(ServletRequestAttributes(mockRequest)) | ||
val conflictList = service.getConflicts(testEdition) | ||
assert( | ||
conflictList[0] == ProjectService.Conflict( | ||
"http://example.com/api/$testEdition/students/" + testStudent.id, | ||
"$scheme://example.com/api/$testEdition/students/" + testStudent.id, | ||
mutableListOf( | ||
"http://example.com/api/$testEdition/projects/" + testProjectConflict.id, | ||
"http://example.com/api/$testEdition/projects/" + testProjectConflict2.id | ||
"$scheme://example.com/api/$testEdition/projects/" + testProjectConflict.id, | ||
"$scheme://example.com/api/$testEdition/projects/" + testProjectConflict2.id | ||
) | ||
) | ||
) | ||
assert( | ||
conflictList[1] == ProjectService.Conflict( | ||
"http://example.com/api/$testEdition/students/" + testStudent2.id, | ||
"$scheme://example.com/api/$testEdition/students/" + testStudent2.id, | ||
mutableListOf( | ||
"http://example.com/api/$testEdition/projects/" + testProjectConflict2.id, | ||
"http://example.com/api/$testEdition/projects/" + testProjectConflict3.id | ||
"$scheme://example.com/api/$testEdition/projects/" + testProjectConflict2.id, | ||
"$scheme://example.com/api/$testEdition/projects/" + testProjectConflict3.id | ||
) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters