-
Notifications
You must be signed in to change notification settings - Fork 5
Vulnerability fix #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Vulnerability fix #155
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c43af82
Merge pull request #143 from delphi-hub/release/1.0.0
ishwaryamamidi 566a8cb
Merge branch 'master' into develop
a449878
- Upgraded play sbt plugin to 2.7.3
941fefd
- Upgraded play-bootstrap to 1.5-P27-B3
4a90c04
Configure compilation issue needs override.
76a9c10
Fixing test case because of compilation failure.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -18,33 +18,28 @@ | |
|
||
package systeminfotest | ||
|
||
import authorization.AuthAction | ||
import controllers.SystemInfoController | ||
import models.SystemInfo | ||
|
||
import scala.concurrent.Future | ||
import org.scalatestplus.play._ | ||
import play.api.libs.json._ | ||
import org.scalatestplus.play.guice.GuiceOneAppPerTest | ||
import play.api.Configuration | ||
import play.api.mvc._ | ||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
import play.api.test._ | ||
|
||
import scala.concurrent.Future | ||
|
||
class SystemInfoTest extends PlaySpec with Results { | ||
|
||
class SystemInfoTest extends PlaySpec with Results with GuiceOneAppPerTest with Injecting { | ||
// TODO Compilation error in commit ecef020fb7ce5fce52733e214d026e76461bf2a6 so replacing with | ||
// a simple test case can be replaced with a better one | ||
"SystemInfo" should { | ||
"should return a valid SystemInfo Json" in { | ||
val controller = new SystemInfoController(stubControllerComponents()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
val config = inject[Configuration] | ||
val auth = inject[AuthAction] | ||
val controller = new SystemInfoController(stubControllerComponents(), config, auth) | ||
val result: Future[Result] = controller.getInfo().apply(FakeRequest()) | ||
val bodyText: String = contentAsString(result) | ||
val json = Json.parse(bodyText) | ||
implicit val systemInfoWrites = Json.writes[SystemInfo] | ||
implicit val systemInfoReads = Json.reads[SystemInfo] | ||
|
||
val validateResult: JsResult[SystemInfo] = json.validate[SystemInfo] | ||
|
||
validateResult.isSuccess mustBe true | ||
|
||
status(result) mustBe UNAUTHORIZED | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need override