package com.adjust.sdk.test;

import com.adjust.sdk.ActivityPackage;
import com.adjust.sdk.IActivityHandler;
import com.adjust.sdk.IAttributionHandler;

import org.json.JSONObject;

/**
 * Created by pfms on 09/01/15.
 */
public class MockAttributionHandler implements IAttributionHandler {
    private MockLogger testLogger;
    private String prefix = "AttributionHandler ";
    IActivityHandler activityHandler;
    JSONObject lastJsonResponse;
    ActivityPackage attributionPackage;

    public MockAttributionHandler(MockLogger testLogger) {
        this.testLogger = testLogger;
    }

    @Override
    public void init(IActivityHandler activityHandler, ActivityPackage attributionPackage, boolean startPaused) {
        testLogger.test(prefix + "init, startPaused: " + startPaused);
        this.activityHandler = activityHandler;
        this.attributionPackage = attributionPackage;
    }

    @Override
    public void getAttribution() {
        testLogger.test(prefix + "getAttribution");
    }

    @Override
    public void checkAttribution(JSONObject jsonResponse) {
        testLogger.test(prefix + "checkAttribution");

        this.lastJsonResponse = jsonResponse;
        /*
        if (activityHandler == null) {
            return;
        }

        JSONObject attributionJson = jsonResponse.optJSONObject("attribution");
        Attribution attribution = Attribution.fromJson(attributionJson);

        if (activityHandler.updateAttribution(attribution)) {
            activityHandler.launchAttributionListener();
        }
        */
    }

    @Override
    public void pauseSending() {
        testLogger.test(prefix + "pauseSending");
    }

    @Override
    public void resumeSending() {
        testLogger.test(prefix + "resumeSending");
    }
}

@@ -1181,383 +1181,8 @@
 se;%0A
-        /*%0A        if (activityHandler == null) %7B%0A            return;%0A        %7D%0A%0A        JSONObject attributionJson = jsonResponse.optJSONObject(%22attribution%22);%0A        Attribution attribution = Attribution.fromJson(attributionJson);%0A%0A        if (activityHandler.updateAttribution(attribution)) %7B%0A            activityHandler.launchAttributionListener();%0A        %7D%0A        */%0A
     

Remove comment