Projects STRLCPY wrongsecrets Commits d03e98fe
🤬
  • ■ ■ ■ ■ ■ ■
    CONTRIBUTING.md
    skipped 300 lines
    301 301   
    302 302   - Make sure that this file is also of **Java** type.
    303 303   - Here is a unit test for reference:
    304  - `java
    305  - package org.owasp.wrongsecrets.challenges.docker;
    306  - import org.assertj.core.api.Assertions;
    307  - import org.junit.jupiter.api.Test;
    308  - import org.junit.jupiter.api.extension.ExtendWith;
    309  - import org.mockito.Mock;
    310  - import org.mockito.Mockito;
    311  - import org.mockito.junit.jupiter.MockitoExtension;
    312  - import org.owasp.wrongsecrets.ScoreCard;
    313  - @ExtendWith(MockitoExtension.class)
    314  - class Challenge28Test {
    315  - @Mock
    316  - private ScoreCard scoreCard;
    317  - @Test
    318  - void rightAnswerShouldSolveChallenge() {
    319  - var challenge = new Challenge28(scoreCard);
    320  - Assertions.assertThat(challenge.solved("wrong answer")).isFalse();
    321  - Assertions.assertThat(challenge.solved(challenge.spoiler().solution())).isTrue();
     304 + ```java
     305 + package org.owasp.wrongsecrets.challenges.docker;
     306 + import org.assertj.core.api.Assertions;
     307 + import org.junit.jupiter.api.Test;
     308 + import org.junit.jupiter.api.extension.ExtendWith;
     309 + import org.mockito.Mock;
     310 + import org.mockito.Mockito;
     311 + import org.mockito.junit.jupiter.MockitoExtension;
     312 + import org.owasp.wrongsecrets.ScoreCard;
     313 + @ExtendWith(MockitoExtension.class)
     314 + class Challenge28Test {
     315 + @Mock
     316 + private ScoreCard scoreCard;
     317 + @Test
     318 + void rightAnswerShouldSolveChallenge() {
     319 + var challenge = new Challenge28(scoreCard);
     320 + Assertions.assertThat(challenge.solved("wrong answer")).isFalse();
     321 + Assertions.assertThat(challenge.solved(challenge.spoiler().solution())).isTrue();
     322 + }
    322 323   }
    323  - }
    324  - `
    325  - Please note that PRs for new challenges are only accepted when unit tests are added to prove that the challenge works. Normally tests should not immediately leak the actual secret, so leverage the `.spoil()` functionality of your test implementation for this.
     324 + ```
     325 +Please note that PRs for new challenges are only accepted when unit tests are added to prove that the challenge works. Normally tests should not immediately leak the actual secret, so leverage the `.spoil()` functionality of your test implementation for this.
    326 326   
    327 327  - ### Step 4: Adding explanations, reasons and hints.
    328 328   
    skipped 40 lines
Please wait...
Page is in error, reload to recover