// Path: src/main/java/com/ibm/ecm/extension/aspera/AsperaPluginException.java
// public class AsperaPluginException extends Exception {
// 	AsperaPluginException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	AsperaPluginException(final String message) {
// 		super(message);
// 	}
// 
// 	AsperaPluginException(final Throwable cause) {
// 		super(cause);
// 	}
// }


import com.ibm.ecm.extension.PluginLogger;
import com.ibm.ecm.extension.aspera.AsperaPluginException;
import com.ibm.json.java.JSONObject;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
package com.ibm.ecm.extension.aspera.faspex;



public class FaspexClientTest {
	private FaspexClient client;
	private JSONObject pluginConfig;

	@Before
	public void setUp() throws Exception {
		// given
		final PluginLogger logger = new PluginLogger("aspera");
		pluginConfig = new JSONObject();
		pluginConfig.put("maxNumberOfRequests", 2);
		client = new FaspexClient(pluginConfig, logger);
	}

	@Test
	public void shouldGetIntegerConfigValue() {
		// when
		final int max = client.getIntegerConfigValue(pluginConfig, "maxNumberOfRequests", 1);
		// then
		assertEquals(2, max);
		// or when
		final int undefined = client.getIntegerConfigValue(pluginConfig, "undefined", 1);
		// then
		assertEquals(1, undefined);
	}

	@Test
// Path: src/main/java/com/ibm/ecm/extension/aspera/AsperaPluginException.java
// public class AsperaPluginException extends Exception {
// 	AsperaPluginException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	AsperaPluginException(final String message) {
// 		super(message);
// 	}
// 
// 	AsperaPluginException(final Throwable cause) {
// 		super(cause);
// 	}
// }


// Path: src/test/java/com/ibm/ecm/extension/aspera/faspex/FaspexClientTest.java
import com.ibm.ecm.extension.PluginLogger;
import com.ibm.ecm.extension.aspera.AsperaPluginException;
import com.ibm.json.java.JSONObject;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

package com.ibm.ecm.extension.aspera.faspex;



public class FaspexClientTest {
	private FaspexClient client;
	private JSONObject pluginConfig;

	@Before
	public void setUp() throws Exception {
		// given
		final PluginLogger logger = new PluginLogger("aspera");
		pluginConfig = new JSONObject();
		pluginConfig.put("maxNumberOfRequests", 2);
		client = new FaspexClient(pluginConfig, logger);
	}

	@Test
	public void shouldGetIntegerConfigValue() {
		// when
		final int max = client.getIntegerConfigValue(pluginConfig, "maxNumberOfRequests", 1);
		// then
		assertEquals(2, max);
		// or when
		final int undefined = client.getIntegerConfigValue(pluginConfig, "undefined", 1);
		// then
		assertEquals(1, undefined);
	}

	@Test
	public void shouldReachMaxNumberOfTransfers() throws AsperaPluginException {