@Test
public void testCreateMember() {

	String postData1, postData2, postData3, postData4;
	IOException error = null;
	testCreateVip();
	testCreatePool();
	postData1 = "{\"id\":\"1\",\"address\":\"10.0.0.3\",\"port\":\"8\",\"pool_id\":\"1\"}";
	postData2 = "{\"id\":\"2\",\"address\":\"10.0.0.4\",\"port\":\"8\",\"pool_id\":\"1\"}";
	postData3 = "{\"id\":\"3\",\"address\":\"10.0.0.5\",\"port\":\"100\",\"pool_id\":\"2\"}";
	postData4 = "{\"id\":\"4\",\"address\":\"10.0.0.6\",\"port\":\"100\",\"pool_id\":\"2\"}";
	try {
		member1 = membersResource.jsonToMember(postData1);
	} catch (IOException e) {
		error = e;
	}
	try {
		member2 = membersResource.jsonToMember(postData2);
	} catch (IOException e) {
		error = e;
	}
	try {
		member3 = membersResource.jsonToMember(postData3);
	} catch (IOException e) {
		error = e;
	}
	try {
		member4 = membersResource.jsonToMember(postData4);
	} catch (IOException e) {
		error = e;
	}
	// verify correct parsing
	assertFalse(member1==null);
	assertFalse(member2==null);
	assertFalse(member3==null);
	assertFalse(member4==null);
	assertTrue(error==null);
	lb.createMember(member1);
	lb.createMember(member2);
	lb.createMember(member3);
	lb.createMember(member4);
	// add the same server a second time
	lb.createMember(member1);
	// verify successful creates
	assertTrue(lb.members.containsKey(member1.id));
	assertTrue(lb.members.containsKey(member2.id));
	assertTrue(lb.members.containsKey(member3.id));
	assertTrue(lb.members.containsKey(member4.id));
	assertTrue(lb.pools.get(member1.poolId).members.size()==2);
	assertTrue(lb.pools.get(member3.poolId).members.size()==2);
	// member1 should inherit valid vipId from pool
	assertTrue(lb.vips.get(member1.vipId)!=null);
}