@ -1,11 +1,17 @@
|
||||
package com.plannaplan.security.cas;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public class CustomUAMCasValidatorTest {
|
||||
|
||||
@Value("${plannaplan.frontendUrl}")
|
||||
private String serviceUrl;
|
||||
|
||||
@Test
|
||||
public void shouldValidateWithDomain() {
|
||||
CustomUAMCasValidator validator = new CustomUAMCasValidator("https://wmi.plannaplan.pl", "ST-54649-5x4h09vzUpEIyAGmf1sz-cas.amu.edu.pl");
|
||||
|
||||
CustomUAMCasValidator validator = new CustomUAMCasValidator(serviceUrl, "ST-54649-5x4h09vzUpEIyAGmf1sz-cas.amu.edu.pl");
|
||||
|
||||
validator.validate();
|
||||
|
||||
|
@ -4,15 +4,20 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public class DefaultUAMCasValidatorTest {
|
||||
|
||||
@Value("${plannaplan.frontendUrl}")
|
||||
private String serviceUrl;
|
||||
|
||||
@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",
|
||||
|
||||
final DefaultUAMCasValidator validator = new DefaultUAMCasValidator(serviceUrl,
|
||||
"ST-572267-cbgKrcJLd0tdCubeLqdW-cas.amu.edu.pl");
|
||||
try {
|
||||
System.out.println(validator.validate());
|
||||
@ -24,7 +29,7 @@ public class DefaultUAMCasValidatorTest {
|
||||
|
||||
@Test
|
||||
public void shouldNotValidateTicket() {
|
||||
final DefaultUAMCasValidator validator = new DefaultUAMCasValidator("http://localhost:3000", "notticket");
|
||||
final DefaultUAMCasValidator validator = new DefaultUAMCasValidator(serviceUrl, "notticket");
|
||||
try {
|
||||
assertTrue(validator.validate().getEmail().trim().equals(""));
|
||||
} catch (CasValidationExcepiton e) {
|
||||
|
Reference in New Issue
Block a user