package pl.szczepanik.silencio.stubs;

import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;

import org.apache.commons.lang3.ArrayUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Stub of @link {@link pl.szczepanik.silencio.core.AbstractProcessor.ObjectMapper} that has only stub methods.
 * 
 * @author Damian Szczepanik (damianszczepanik@github)
 */
public class StubObjectMapper extends ObjectMapper {

    private Iterator<String> jsons;

    private IOException exception;

    public StubObjectMapper(IOException exception) {
        this.exception = exception;
    }

    public StubObjectMapper(String... jsons) {
        if (ArrayUtils.isEmpty(jsons)) {
            this.jsons = Arrays.asList(jsons).iterator();
        }
    }

    public <T> T readValue(String content, Class<T> valueType) throws IOException {
        if (exception != null) {
            throw exception;
        } else if (jsons == null) {
            return null;
        } else {
            return super.readValue(jsons.next(), valueType);
        }
    }
}

@@ -36,36 +36,8 @@
 s;%0A%0A
-import java.io.IOException;%0A
 impo
@@ -96,173 +96,245 @@
 ort 
-org.apache.commons.lang3.ArrayUtils;%0A%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0A%0A/**%0A * Stub of @link %7B@link pl.szczepanik.silencio.core.AbstractProcessor.
+com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.databind.JsonMappingException;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport org.apache.commons.lang3.ArrayUtils;%0A%0A/**%0A * Stub of @link %7B@link 
 Obje
@@ -537,18 +537,27 @@
 private 
-IO
+JsonMapping
 Exceptio
@@ -598,18 +598,27 @@
 tMapper(
-IO
+JsonMapping
 Exceptio
@@ -904,18 +904,51 @@
 ype)
- 
 throws 
-IO
+JsonProcessingException, JsonMapping
 Exce

Fix broken API compatibility