package org.apereo.cas.support.realm;

import lombok.val;
import org.apache.cxf.sts.token.realm.RealmProperties;
import org.apache.cxf.ws.security.sts.provider.STSException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.AfterEach;

import static org.apereo.cas.util.junit.Assertions.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;

import static org.mockito.Mockito.*;
import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Tag;

import java.util.Map;

/**
 * This is {@link UriRealmParserTests}.
 *
 * @author Misagh Moayyed
 * @since 6.3.0
 */
@Tag("WSFederation")
public class UriRealmParserTests {

    @Test
    public void verifySingleToken() {
        val properties = new RealmProperties();
        val parser = new UriRealmParser(Map.of("APEREO.ORG", properties));
        assertEquals("APEREO.ORG", parser.parseRealm(Map.of("org.apache.cxf.request.url", "https://apereo.org/cas")));
        assertThrows(STSException.class, () ->
            parser.parseRealm(Map.of("org.apache.cxf.request.url", "https://example.org/cas")));
    }
}

@@ -200,18 +200,11 @@
 api.
-BeforeEach
+Tag
 ;%0Aim
@@ -240,451 +240,80 @@
 st;%0A
-import org.junit.jupiter.api.Tag;%0Aimport org.junit.jupiter.api.AfterEach;%0A%0Aimport static org.apereo.cas.util.junit.Assertions.*;%0Aimport static org.springframework.test.web.client.match.MockRestRequestMatchers.*;%0Aimport static org.springframework.test.web.client.response.MockRestResponseCreators.*;%0A%0Aimport static org.mockito.Mockito.*;%0Aimport static org.junit.jupiter.api.Assertions.*;%0A%0Aimport org.junit.jupiter.api.Tag;%0A%0Aimport java.util.Map
+%0Aimport java.util.Map;%0A%0Aimport static org.junit.jupiter.api.Assertions.*
 ;%0A%0A/
@@ -497,14 +497,8 @@
 rify
-Single
 Toke

add tests