"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/cas-server-core-tickets/src/test/java/org/apereo/cas/ticket/TicketSerializersTests.java" between
cas-6.0.4.tar.gz and cas-6.0.5.tar.gz

About: CAS (Central Authentication Service) is an authentication system (providing single sign-on service).

TicketSerializersTests.java  (cas-6.0.4):TicketSerializersTests.java  (cas-6.0.5)
skipping to change at line 28 skipping to change at line 28
import org.junit.ClassRule; import org.junit.ClassRule;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule; import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule; import org.springframework.test.context.junit4.rules.SpringMethodRule;
import java.util.Map;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/** /**
* This is {@link TicketSerializersTests}. * This is {@link TicketSerializersTests}.
* *
* @author Misagh Moayyed * @author Misagh Moayyed
* @since 6.0.0 * @since 6.0.0
*/ */
@SpringBootTest(classes = { @SpringBootTest(classes = {
RefreshAutoConfiguration.class, RefreshAutoConfiguration.class,
skipping to change at line 108 skipping to change at line 110
val pgtFactory = (ProxyGrantingTicketFactory) this.defaultTicketFactory. get(ProxyGrantingTicket.class); val pgtFactory = (ProxyGrantingTicketFactory) this.defaultTicketFactory. get(ProxyGrantingTicket.class);
val pgt = pgtFactory.create(st, tgt.getAuthentication(), ProxyGrantingTi cket.class); val pgt = pgtFactory.create(st, tgt.getAuthentication(), ProxyGrantingTi cket.class);
val ptFactory = (ProxyTicketFactory) this.defaultTicketFactory.get(Proxy Ticket.class); val ptFactory = (ProxyTicketFactory) this.defaultTicketFactory.get(Proxy Ticket.class);
val pt = ptFactory.create(pgt, st.getService(), ProxyTicket.class); val pt = ptFactory.create(pgt, st.getService(), ProxyTicket.class);
verifySerialization(pt); verifySerialization(pt);
} }
@Test
public void verifyTransientSessionTicketSerialization() {
val factory = (TransientSessionTicketFactory) this.defaultTicketFactory.
get(TransientSessionTicket.class);
val ticket = factory.create(RegisteredServiceTestUtils.getService(), Map
.of("a", "b"));
val serialized = BaseTicketSerializers.serializeTicket(ticket);
assertNotNull(serialized);
val deserialized = BaseTicketSerializers.deserializeTicket(serialized, t
icket.getClass());
assertNotNull(deserialized);
assertEquals("b", deserialized.getProperties().get("a"));
}
private static void verifySerialization(final Ticket ticket) { private static void verifySerialization(final Ticket ticket) {
val serialized = BaseTicketSerializers.serializeTicket(ticket); val serialized = BaseTicketSerializers.serializeTicket(ticket);
assertNotNull(serialized); assertNotNull(serialized);
val deserialized = BaseTicketSerializers.deserializeTicket(serialized, t icket.getClass()); val deserialized = BaseTicketSerializers.deserializeTicket(serialized, t icket.getClass());
assertNotNull(deserialized); assertNotNull(deserialized);
} }
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)