package de.kosit.validationtool.config;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

import org.junit.Test;

import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.ResolvingMode;
import de.kosit.validationtool.impl.xml.StrictLocalResolvingStrategy;

/**
 * @author Andreas Penski
 */
public class ConfigurationLoaderTest {

    @Test
    public void testCustomResolvingStrategy() {
        final ConfigurationLoader loader = TestConfigurationFactory.loadSimpleConfiguration();
        final ResolvingConfigurationStrategy strategy = mock(ResolvingConfigurationStrategy.class);
        loader.setResolvingStrategy(strategy);
        loader.setResolvingMode(ResolvingMode.STRICT_LOCAL);
        final Configuration config = loader.build();
        assertThat(config.getContentRepository().getResolvingConfigurationStrategy()).isNotInstanceOf(StrictLocalResolvingStrategy.class);
    }
}

@@ -95,48 +95,8 @@
 hat;
-%0Aimport static org.mockito.Mockito.mock;
 %0A%0Aim
@@ -198,19 +198,20 @@
 iontool.
-api
+impl
 .Resolvi
@@ -212,37 +212,20 @@
 esolving
-ConfigurationStrategy
+Mode
 ;%0Aimport
@@ -246,32 +246,42 @@
 dationtool.impl.
+xml.Remote
 ResolvingMode;%0Ai
@@ -265,36 +265,40 @@
 .RemoteResolving
-Mode
+Strategy
 ;%0Aimport de.kosi
@@ -325,29 +325,32 @@
 l.xml.Strict
-Local
+Relative
 ResolvingStr
@@ -596,118 +596,54 @@
     
-final ResolvingConfigurationStrategy strategy = mock(ResolvingConfigurationStrategy.class);%0A        loader.set
+loader.setResolvingStrategy(new StrictRelative
 Reso
@@ -660,16 +660,9 @@
 egy(
-strategy
+)
 );%0A 
@@ -710,20 +710,20 @@
 ode.
-STRICT_LOCAL
+ALLOW_REMOTE
 );%0A 
@@ -880,19 +880,14 @@
 eOf(
-StrictLocal
+Remote
 Reso

fix test