package com.google.code.maven_replacer_plugin;

import static org.junit.Assert.assertNotNull;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;


@RunWith(MockitoJUnitRunner.class)
public class ReplacerFactoryTest {
	@Mock
	private Replacement replacement;

	@Test
	public void shouldReturnReplacerWithFileUtilsAndTokenReplacer() {
		ReplacerFactory factory = new ReplacerFactory();

		Replacer replacer = factory.create(replacement);
		assertNotNull(replacer);
	}
}

@@ -224,16 +224,101 @@
 unner;%0D%0A
+import static org.mockito.Mockito.when;%0D%0Aimport static org.junit.Assert.assertTrue;%0D%0A
 %0D%0A%0D%0A@Run
@@ -463,16 +463,21 @@
 ldReturn
+Token
 Replacer
@@ -481,90 +481,365 @@
 cerW
-ithFileUtilsAndTokenReplacer() %7B%0D%0A%09%09ReplacerFactory factory = new ReplacerFactory(
+henNotUsingXPath() %7B%0D%0A%09%09ReplacerFactory factory = new ReplacerFactory();%0D%0A%0D%0A%09%09Replacer replacer = factory.create(replacement);%0D%0A%09%09assertTrue(replacer instanceof TokenReplacer);%0D%0A%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void shouldReturnXPathReplacerWhenUsingXPath() %7B%0D%0A%09%09ReplacerFactory factory = new ReplacerFactory();%0D%0A%09%09when(replacement.getXpath()).thenReturn(%22some xpath%22
 );%0D%0A
@@ -904,17 +904,39 @@
 sert
-NotNull(r
+True(replacer instanceof XPathR
 epla

test cases to ensure correct replacer returns