Search in sources :

Example 1 with GitServiceRegistryProperties

use of org.apereo.cas.configuration.model.support.git.services.GitServiceRegistryProperties in project cas by apereo.

the class TypeAwareGitRepositoryRegisteredServiceLocatorTests method verifyOperation.

@Test
public void verifyOperation() throws Exception {
    val strategy = new DefaultRegisteredServiceResourceNamingStrategy();
    val locator = new TypeAwareGitRepositoryRegisteredServiceLocator(strategy, FileUtils.getTempDirectory(), new GitServiceRegistryProperties().setRootDirectory("sample-root"));
    val service = RegisteredServiceTestUtils.getRegisteredService();
    val file = locator.determine(service, "json");
    assertTrue(file.getCanonicalPath().endsWith("sample-root" + File.separator + service.getFriendlyName() + File.separator + strategy.build(service, "json")));
}
Also used : lombok.val(lombok.val) DefaultRegisteredServiceResourceNamingStrategy(org.apereo.cas.services.resource.DefaultRegisteredServiceResourceNamingStrategy) TypeAwareGitRepositoryRegisteredServiceLocator(org.apereo.cas.services.locator.TypeAwareGitRepositoryRegisteredServiceLocator) GitServiceRegistryProperties(org.apereo.cas.configuration.model.support.git.services.GitServiceRegistryProperties) Test(org.junit.jupiter.api.Test)

Example 2 with GitServiceRegistryProperties

use of org.apereo.cas.configuration.model.support.git.services.GitServiceRegistryProperties in project cas by apereo.

the class DefaultGitRepositoryRegisteredServiceLocatorTests method verifyOperation.

@Test
public void verifyOperation() throws Exception {
    val strategy = new DefaultRegisteredServiceResourceNamingStrategy();
    val locator = new DefaultGitRepositoryRegisteredServiceLocator(strategy, FileUtils.getTempDirectory(), new GitServiceRegistryProperties().setRootDirectory("sample-root"));
    val service = RegisteredServiceTestUtils.getRegisteredService();
    val file = locator.determine(service, "json");
    assertTrue(file.getCanonicalPath().endsWith("sample-root" + File.separator + strategy.build(service, "json")));
}
Also used : lombok.val(lombok.val) DefaultRegisteredServiceResourceNamingStrategy(org.apereo.cas.services.resource.DefaultRegisteredServiceResourceNamingStrategy) GitServiceRegistryProperties(org.apereo.cas.configuration.model.support.git.services.GitServiceRegistryProperties) DefaultGitRepositoryRegisteredServiceLocator(org.apereo.cas.services.locator.DefaultGitRepositoryRegisteredServiceLocator) Test(org.junit.jupiter.api.Test)

Aggregations

lombok.val (lombok.val)2 GitServiceRegistryProperties (org.apereo.cas.configuration.model.support.git.services.GitServiceRegistryProperties)2 DefaultRegisteredServiceResourceNamingStrategy (org.apereo.cas.services.resource.DefaultRegisteredServiceResourceNamingStrategy)2 Test (org.junit.jupiter.api.Test)2 DefaultGitRepositoryRegisteredServiceLocator (org.apereo.cas.services.locator.DefaultGitRepositoryRegisteredServiceLocator)1 TypeAwareGitRepositoryRegisteredServiceLocator (org.apereo.cas.services.locator.TypeAwareGitRepositoryRegisteredServiceLocator)1