package com.cognifide.slice.mapper.impl.processor;

import java.lang.reflect.Field;

import org.apache.sling.api.resource.Resource;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

public class SliceResourceFieldProcessorTest {

	@Mock
	private Resource resource;

	private SliceResourceFieldProcessor processor;

	@Before
	public void setUp() throws SecurityException, NoSuchFieldException {
		processor = new SliceResourceFieldProcessor();
	}

	@Test
	public void testAcceptString() throws SecurityException, NoSuchFieldException {
		Field field = TestObject.class.getDeclaredField("stringField");
		boolean result = processor.accepts(resource, field);
		Assert.assertFalse("String field should not be acceptable", result);
	}

	@Test
	public void testAcceptPrimitive() throws SecurityException, NoSuchFieldException {
		Field field = TestObject.class.getDeclaredField("booleanField");
		boolean result = processor.accepts(resource, field);
		Assert.assertFalse("Primitive field should not be acceptable", result);

		field = TestObject.class.getDeclaredField("intField");
		result = processor.accepts(resource, field);
		Assert.assertFalse("Primitive field should not be acceptable", result);
	}

	@Test
	public void testAcceptAnnotated() throws SecurityException, NoSuchFieldException {
		Field field = TestObject.class.getDeclaredField("annotatedField");
		boolean result = processor.accepts(resource, field);
		Assert.assertTrue("Annotated field should be acceptable", result);
	}

}

@@ -213,22 +213,137 @@
 org.
-mockito.Mock;%0A
+junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)
 %0Apub

Test fix