package org.sagebionetworks.repo.model.dbo.persistence.discussion;

import static org.junit.Assert.*;

import org.junit.Test;
import org.sagebionetworks.repo.model.discussion.Forum;

public class ForumUtilsTest {
	private static final Long ID = 123L;
	private static final Long PROJECT_ID = 987L;

	@Test
	public void testDBOToDTOAndBack() {
		DBOForum dbo = new DBOForum();
		dbo.setId(ID);
		dbo.setProjectId(PROJECT_ID);
		// From DBO to DTO
		Forum dto = ForumUtils.createDTOFromDBO(dbo);
		assertEquals(dto.getId(), ID);
		assertEquals(dto.getProjectId(), PROJECT_ID);
		// From DTO to DBO
		DBOForum dbo2 = ForumUtils.createDBOFromDTO(dto);
		assertEquals(dbo, dbo2);
	}

}

@@ -174,16 +174,70 @@
 n.Forum;
+%0Aimport org.sagebionetworks.repo.model.jdo.KeyFactory;
 %0A%0Apublic
@@ -570,16 +570,27 @@
 Id(), ID
+.toString()
 );%0A%09%09ass
@@ -595,24 +595,47 @@
 ssertEquals(
+KeyFactory.stringToKey(
 dto.getProje
@@ -640,16 +640,17 @@
 jectId()
+)
 , PROJEC

update test