@Test
    void verifyNewSamlServiceProvider() throws Throwable {
        val entity = mock(EntityDescriptor.class);
        when(entity.getEntityID()).thenReturn(RegisteredServiceTestUtils.CONST_TEST_URL);
        val resolver = mock(SamlRegisteredServiceCachingMetadataResolver.class);

        val metadataResolver = mock(MetadataResolver.class);
        when(metadataResolver.resolveSingle(any(CriteriaSet.class))).thenReturn(entity);

        val result = CachedMetadataResolverResult.builder().metadataResolver(metadataResolver).build();
        when(resolver.resolve(any(SamlRegisteredService.class), any(CriteriaSet.class))).thenReturn(result);

        val sp = new SamlServiceProviderProperties.Dropbox();
        sp.setMetadata("https://metadata.dropbox.com");
        sp.setEntityIds(CollectionUtils.wrap(RegisteredServiceTestUtils.CONST_TEST_URL));
        val service = SamlSPUtils.newSamlServiceProviderService(sp, resolver);
        assertNotNull(service);
        assertEquals(RegisteredServiceTestUtils.CONST_TEST_URL, service.getServiceId());
    }
This is {@link SamlSPUtilsTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-sp-integrations/src/test/java/org/apereo/cas/util/SamlSPUtilsTests.java