Skip to content

Commit

Permalink
OWASP#810 update the challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshuagarwal-23 committed Oct 18, 2023
1 parent dc4b1e0 commit eed9ee2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
*/
@Slf4j
@Component
@Order(41)
public class Challenge41 extends Challenge {
@Order(42)
public class Challenge42 extends Challenge {

private final Resource resource;

public Challenge41(
public Challenge42(
ScoreCard scoreCard, @Value("classpath:maven/settings/settings.xml") Resource resource) {
super(scoreCard);
this.resource = resource;
Expand Down Expand Up @@ -81,7 +81,7 @@ private String getSolution() {
// Retrieve the Nexus password
return xmlConfiguration.getString("nexus.password");
} catch (Exception e) {
log.warn("there was an exception with decrypting content in challenge41", e);
log.warn("there was an exception with decrypting content in challenge42", e);
return "error_decryption";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.mockito.Mockito.when;

@ExtendWith(MockitoExtension.class)
class Challenge41Test {
class Challenge42Test {
@Mock private ScoreCard scoreCard;

@Mock private Resource resource;
Expand All @@ -28,14 +28,14 @@ void setUp() throws IOException {

@Test
void spoilerShouldGiveAnswer() {
var challenge = new Challenge41(scoreCard, resource);
var challenge = new Challenge42(scoreCard, resource);
Assertions.assertThat(challenge.spoiler().solution()).isNotEmpty();
Assertions.assertThat(challenge.answerCorrect(challenge.spoiler().solution())).isTrue();
}

@Test
void incorrectAnswerShouldNotSolveChallenge() {
var challenge = new Challenge41(scoreCard, resource);
var challenge = new Challenge42(scoreCard, resource);
Assertions.assertThat(challenge.answerCorrect("wrong answer")).isFalse();
}
}

0 comments on commit eed9ee2

Please sign in to comment.