Skip to content
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

[JAVA] CRJVM207 - 10 MILLIARDS - Customer data must have end-of-life information #168

Closed
Prev Previous commit
Next Next commit
adding CookieWithoutExpiration Test case
Said MOHAMEDALI authored and Said MOHAMEDALI committed Apr 5, 2023
commit 80260e35d339e921f325b5ecad456b8f3bce6253
4 changes: 2 additions & 2 deletions java-plugin/src/test/files/CookieWithoutExpirationCheck.java
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
import java.util.Collection;
import java.util.Collections;

class CustomerDataCopyCheck {
class TestClass {

public void NOK_CookieCreation() {
// create objet cookie 
// create objet cookie
Cookie C = new Cookie("id","674684641");
// set the validity
C.setMaxAge(24*3600);
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package fr.greencodeinitiative.java.checks;

import org.junit.jupiter.api.Test;
import org.sonar.java.checks.verifier.CheckVerifier;
import org.sonar.plugins.java.api.JavaFileScanner;

class CookieWithExpirationCheckTest {

/**
* @formatter:off
*/
@Test
void test() {
CheckVerifier.newVerifier()
.onFile("src/test/files/CookieWithoutExpirationCheck.java")
.withCheck(new CookieWithoutExpirationRule())
.verifyIssues();
}

}