package com.socialize.sample.integrationtest.runonprod;
import com.socialize.sample.integrationtest.SocializeRobotiumTest;
import android.widget.TextView;

public class EntityTest extends SocializeRobotiumTest {

	@Override
	public void setUp() throws Exception {
		super.setUp();
		authenticateSocialize();
		
		robotium.clickOnButton("Entity");
		robotium.waitForActivity("EntityActivity", DEFAULT_TIMEOUT_SECONDS);
	}
	
	public void testGetEntity() {
		// We need create first
		robotium.enterText(0, DEFAULT_GET_ENTITY);
		robotium.enterText(1, "RobotiumEntityTest");
		
		String entityKey = getEntityKey();
		
		robotium.clickOnButton("Get Entity");
		
		waitForSuccess();
		
		String entityKey2 = getEntityKey();
		
		assertEquals(entityKey, entityKey2);
	}
	
	private String getEntityKey() {
		
		sleep(2000); // Wait for text field to be updated
		
		TextView txt = (TextView) robotium.getCurrentActivity().findViewById(com.socialize.sample.R.id.txtEntityKeyCreated);
		
		// This is ID, it should be integer
		assertNotNull(txt);
		
		return txt.getText().toString();
	}
}
@@ -522,95 +522,8 @@
 Y);%0A
-%09%09robotium.enterText(1, %22RobotiumEntityTest%22);%0A%09%09%0A%09%09String entityKey = getEntityKey();%0A
 %09%09%0A%09
@@ -643,25 +643,34 @@
 tEquals(
-entityKey
+DEFAULT_GET_ENTITY
 , entity

change getEntity