package com.growthbeat.model;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import org.junit.Test;

import com.growthbeat.BaseTest;
import com.growthbeat.GrowthbeatException;

public class ClientTest extends BaseTest {

	@Test
	public void findById() {
		Client client = Client.findById("qz4Jf0fNB7lQvhZf", CREDENTIAL_ID);
		assertEquals("qz4Jf0fNB7lQvhZf", client.getId());
		assertEquals("J9yz06sdPs0buwHP", client.getApplication().getId());
		assertEquals(1404831236000L, client.getCreated().getTime());
	}

	@Test
	public void findByApplicationId() {
		// List<Client> clients = Client.findByApplicationId("J9yz06sdPs0buwHP",
		// null, Order.ascending, null, CREDENTIAL_ID);
	}

	@Test
	public void create() {
		Client client = Client.create("J9yz06sdPs0buwHP", CREDENTIAL_ID);
		assertNotNull(client.getId());
		assertEquals("J9yz06sdPs0buwHP", client.getApplication().getId());
		assertNotNull(client.getCreated());
	}

	@Test
	public void deleteById() {
		try {
			Client.deleteByid("Dummy", CREDENTIAL_ID);
			fail();
		} catch (GrowthbeatException e) {
		}
	}

}

@@ -146,20 +146,87 @@
 .Assert.
-fail
+assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.List
 ;%0A%0Aimpor
@@ -701,19 +701,16 @@
 d() %7B%0A%09%09
-// 
 List%3CCli
@@ -774,13 +774,8 @@
 HP%22,
-%0A%09%09//
  nul
@@ -816,16 +816,50 @@
 AL_ID);%0A
+%09%09assertTrue(clients.size() %3E 0);%0A
 %09%7D%0A%0A%09@Te

Remove comment out in ClientTest