38 lines
1.1 KiB
Java
Executable File
38 lines
1.1 KiB
Java
Executable File
package com.plannaplan.security;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
import org.junit.Ignore;
|
|
import org.junit.Test;
|
|
|
|
public class DefaultUAMCasValidatorTest {
|
|
|
|
@Test
|
|
@Ignore
|
|
public void shouldValidateTicket() {
|
|
// you need to privide fresh ticket to make this test pass that's why it is
|
|
// marked as ignored
|
|
final DefaultUAMCasValidator validator = new DefaultUAMCasValidator("http://localhost:3000",
|
|
"ST-572267-cbgKrcJLd0tdCubeLqdW-cas.amu.edu.pl");
|
|
try {
|
|
System.out.println(validator.validate());
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
assertTrue(false);
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void shouldNotValidateTicket() {
|
|
final DefaultUAMCasValidator validator = new DefaultUAMCasValidator("http://localhost:3000", "notticket");
|
|
try {
|
|
assertTrue(validator.validate().trim().equals(""));
|
|
} catch (CasValidationExcepiton e) {
|
|
assertTrue(true);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
assertTrue(false);
|
|
}
|
|
}
|
|
}
|