Skip to content

Commit

Permalink
#44 front end JavaScript library with key obfuscated - review
Browse files Browse the repository at this point in the history
  • Loading branch information
drnow4u committed Apr 2, 2022
1 parent 2b7222a commit 85438d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions js/index.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public List<RuntimeEnvironment.Environment> supportedRuntimeEnvironments() {

public String getActualData() {
try {
return Files.readString(Paths.get(dockerMountPath, "yourkey.txt"));
return Files.readString(Paths.get(dockerMountPath, "secondkey.txt"));
} catch (Exception e) {
log.warn("Exception during file reading, defaulting to default without cloud environment", e);
return "if_you_see_this_please_use_docker_instead";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class Challenge16Test {
private ScoreCard scoreCard;

@Test
void solveChallenge15WithoutFile(@TempDir Path dir) {
void solveChallenge16WithoutFile(@TempDir Path dir) {
var challenge = new Challenge16(scoreCard, dir.toString());

Assertions.assertThat(challenge.answerCorrect("secretvalueWitFile")).isFalse();
Assertions.assertThat(challenge.answerCorrect("if_you_see_this_please_use_docker_instead")).isTrue();
}

@Test
void solveChallenge15WithMNTFile(@TempDir Path dir) throws Exception {
var testFile = new File(dir.toFile(), "yourkey.txt");
void solveChallenge16WithMNTFile(@TempDir Path dir) throws Exception {
var testFile = new File(dir.toFile(), "secondkey.txt");
var secret = "secretvalueWitFile";
Files.writeString(testFile.toPath(), secret);

Expand All @@ -41,7 +41,7 @@ void solveChallenge15WithMNTFile(@TempDir Path dir) throws Exception {

@Test
void spoilShouldReturnCorrectAnswer(@TempDir Path dir) throws IOException {
var testFile = new File(dir.toFile(), "yourkey.txt");
var testFile = new File(dir.toFile(), "secondkey.txt");
var secret = "secretvalueWitFile";
Files.writeString(testFile.toPath(), secret);

Expand Down

0 comments on commit 85438d8

Please sign in to comment.