@@ -0,0 +1,2152 @@
+package org.sagebionetworks.web.unitclient.widget.entity.tabs;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.mockito.Matchers.eq;%0Aimport static org.mockito.Mockito.never;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.ArgumentCaptor;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.sagebionetworks.web.client.place.Synapse;%0Aimport org.sagebionetworks.web.client.place.Synapse.EntityArea;%0Aimport org.sagebionetworks.web.client.utils.CallbackP;%0Aimport org.sagebionetworks.web.client.widget.entity.tabs.DiscussionTab;%0Aimport org.sagebionetworks.web.client.widget.entity.tabs.DiscussionTabView;%0Aimport org.sagebionetworks.web.client.widget.entity.tabs.Tab;%0A%0Aimport com.google.gwt.user.client.ui.Widget;%0A%0Apublic class DiscussionTabTest %7B%0A%09@Mock%0A%09Tab mockTab;%0A%09@Mock%0A%09DiscussionTabView mockView;%0A%09@Mock%0A%09CallbackP%3CTab%3E mockOnClickCallback;%0A%09%0A%09DiscussionTab tab;%0A%09%0A%09@Before%0A%09public void setUp() %7B%0A%09%09MockitoAnnotations.initMocks(this);%0A%09%09tab = new DiscussionTab(mockView, mockTab);%0A%09%7D%0A%0A%09@Test%0A%09public void testConstruction() %7B%0A%09%09verify(mockTab).configure(Mockito.anyString(), (Widget) Mockito.any()); %0A%09%7D%0A%09%0A%09@Test%0A%09public void testSetTabClickedCallback() %7B%0A%09%09tab.setTabClickedCallback(mockOnClickCallback);%0A%09%09verify(mockTab).addTabClickedCallback(mockOnClickCallback);%0A%09%7D%0A%0A%09@Test%0A%09public void testConfigure() %7B%0A%09%09String entityId = %22syn1%22; %0A%09%09String entityName = %22discussion project test%22;%0A%09%09tab.configure(entityId, entityName);%0A%0A%09%09verify(mockTab).setTabListItemVisible(false);%0A%09%09verify(mockTab, never()).setTabListItemVisible(true);%0A%0A%09%09ArgumentCaptor%3CSynapse%3E captor = ArgumentCaptor.forClass(Synapse.class);%0A%09%09verify(mockTab).setEntityNameAndPlace(eq(entityName), captor.capture());%0A%09%09Synapse place = captor.getValue();%0A%09%09assertEquals(entityId, place.getEntityId());%0A%09%09assertNull(place.getVersionNumber());%0A%09%09assertEquals(EntityArea.DISCUSSION, place.getArea());%0A%09%09assertNull(place.getAreaToken());%0A%09%7D%0A%0A%09@Test%0A%09public void testAsTab() %7B%0A%09%09assertEquals(mockTab, tab.asTab());%0A%09%7D%0A%7D%0A

add test