package com.growthbeat;

import org.junit.Before;
import org.junit.BeforeClass;

import com.growthbeat.model.Account;
import com.growthbeat.model.Application;
import com.growthbeat.model.Client;
import com.growthbeat.model.Connection;
import com.growthbeat.model.Credential;
import com.growthbeat.model.Session;

public class BaseTest {

	protected static final String BASE_URL = "http://api.growthbeat.com/";
	protected static final String CREDENTIAL_ID = "wXvp0nuo3SmR5zMDAtuoKMxElgUgN968";
	protected static final String SERVICE_ID = "5FjbhqsIHTGdfVeP";

	protected static Account testAccount = null;
	protected static Credential testCredential = null;
	protected static Application testApplication = null;
	protected static Client testClient = null;
	protected static Connection testConnection = null;
	protected static Session testSession = null;

	protected Growthbeat growthbeat = null;

	@BeforeClass
	public static void beforeClass() {
		if (testAccount == null)
			init();
	}

	@Before
	public void before() {
		growthbeat = createGrowthbeat(testCredential.getId());
	}

	private static void init() {

		Growthbeat parentGrowthbeat = createGrowthbeat(CREDENTIAL_ID);

		testAccount = parentGrowthbeat.createAccount();
		testCredential = parentGrowthbeat.createCredential(testAccount.getId());

		Growthbeat childGrowthbeat = createGrowthbeat(testCredential.getId());

		testApplication = childGrowthbeat.createApplication("Java SDK");
		testClient = childGrowthbeat.createClient(testApplication.getId());
		testConnection = childGrowthbeat.createConnection(testAccount.getId(), SERVICE_ID);
		testSession = childGrowthbeat.createSession(testAccount.getId(), SERVICE_ID);

	}

	protected static Growthbeat createGrowthbeat(String credentialId) {
		Growthbeat growthbeat = new Growthbeat(CREDENTIAL_ID);
		growthbeat.getContext().getGrowthbeatHttpClient().setBaseUrl(BASE_URL);
		return growthbeat;
	}

}

@@ -1789,29 +1789,28 @@
 wthbeat(
-CREDENTIAL_ID
+credentialId
 );%0A%09%09gro

Fix credential for test