1212
1313public class TenantTest extends JsonTest <Tenant > {
1414
15- private static final String json = "{\" change_password\" :{},\" guardian_mfa_page\" :{},\" default_audience\" :\" https://domain.auth0.com/myapi\" ,\" default_directory\" :\" Username-Password-Authentication\" ,\" error_page\" :{},\" flags\" :{},\" friendly_name\" :\" My-Tenant\" ,\" picture_url\" :\" https://pic.to/123\" ,\" support_email\" :\" support@auth0.com\" ,\" support_url\" :\" https://support.auth0.com\" ,\" allowed_logout_urls\" :[\" https://domain.auth0.com/logout\" ], \" session_lifetime\" :24, \" idle_session_lifetime\" :0.5}" ;
15+ private static final String json = "{\" change_password\" :{},\" guardian_mfa_page\" :{},\" default_audience\" :\" https://domain.auth0.com/myapi\" ,\" default_directory\" :\" Username-Password-Authentication\" ,\" error_page\" :{},\" flags\" :{},\" friendly_name\" :\" My-Tenant\" ,\" picture_url\" :\" https://pic.to/123\" ,\" support_email\" :\" support@auth0.com\" ,\" support_url\" :\" https://support.auth0.com\" ,\" allowed_logout_urls\" :[\" https://domain.auth0.com/logout\" ], \" session_lifetime\" :24, \" idle_session_lifetime\" :0.5, \" session_cookie\" :{\" mode\" : \" persistent\" }}" ;
16+
1617
1718 @ Test
1819 public void shouldSerialize () throws Exception {
@@ -30,6 +31,7 @@ public void shouldSerialize() throws Exception {
3031 tenant .setAllowedLogoutUrls (Collections .singletonList ("https://domain.auth0.com/logout" ));
3132 tenant .setSessionLifetime (48 );
3233 tenant .setIdleSessionLifetime (0 );
34+ tenant .setSessionCookie (new SessionCookie ("persistent" ));
3335
3436 String serialized = toJSON (tenant );
3537 assertThat (serialized , is (notNullValue ()));
@@ -47,6 +49,7 @@ public void shouldSerialize() throws Exception {
4749 assertThat (serialized , JsonMatcher .hasEntry ("allowed_logout_urls" , Arrays .asList ("https://domain.auth0.com/logout" )));
4850 assertThat (serialized , JsonMatcher .hasEntry ("session_lifetime" , 48 ));
4951 assertThat (serialized , JsonMatcher .hasEntry ("idle_session_lifetime" , 0 ));
52+ assertThat (serialized , JsonMatcher .hasEntry ("session_cookie" , notNullValue ()));
5053 }
5154
5255 @ Test
@@ -67,6 +70,8 @@ public void shouldDeserialize() throws Exception {
6770 assertThat (tenant .getAllowedLogoutUrls (), contains ("https://domain.auth0.com/logout" ));
6871 assertThat (tenant .getSessionLifetime (), is (24 ));
6972 assertThat (tenant .getIdleSessionLifetime (), is (0 ));
73+ assertThat (tenant .getSessionCookie (), is (notNullValue ()));
74+ assertThat (tenant .getSessionCookie ().getMode (), is ("persistent" ));
7075 }
7176
7277}
0 commit comments