mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testSetPid() throws FactoryObjectInformationException, IllegalArgumentException, 
        PersistenceFailedException, InvalidProtocolBufferException
    {
        //mock factory object data entity
        UUID uuid = UUID.randomUUID();
        FactoryObjectData factData = createFactoryObjectData("name", null);
        PersistentData persistentData = createPersistentData(uuid, factData.toByteArray());
    
        String pid = "setMe";
    
        m_SUT.setPid(uuid, pid);
    
        //verify that the persistent data entry is updated with a new version of the factoryObjectData
        //capture what was set
        ArgumentCaptor<Serializable> messageCap = ArgumentCaptor.forClass(Serializable.class);
        verify(persistentData).setEntity(messageCap.capture());
        
        //parse the updated data from the capture
        FactoryObjectData updatedFactData = FactoryObjectData.parseFrom((byte[])messageCap.getValue());
 
        //verify that the data has no Pid
        assertThat(updatedFactData.getPid(), is(pid));
    }
/**
     * Verify the expected behavior of setPid() when the factory data exists
     * - data should be updated with the given PID
     */
Verify the expected behavior of setPid() when the factory data exists
- data should be updated with the given PID
Verify the expected behavior of setPid () when the factory data exists - data should be updated with the given PID
@Test
    public void testSetPid() throws FactoryObjectInformationException, IllegalArgumentException, 
        PersistenceFailedException, InvalidProtocolBufferException
    {
        UUID uuid = UUID.randomUUID();
        FactoryObjectData factData = createFactoryObjectData("name", null);
        PersistentData persistentData = createPersistentData(uuid, factData.toByteArray());
        String pid = "setMe";
        m_SUT.setPid(uuid, pid);
        ArgumentCaptor<Serializable> messageCap = ArgumentCaptor.forClass(Serializable.class);
        verify(persistentData).setEntity(messageCap.capture());
        FactoryObjectData updatedFactData = FactoryObjectData.parseFrom((byte[])messageCap.getValue());
        assertThat(updatedFactData.getPid(), is(pid));
    }
@ Test public void testSetPid ( ) throws FactoryObjectInformationException , IllegalArgumentException , PersistenceFailedException , InvalidProtocolBufferException { UUID uuid = UUID . randomUUID ( ) ; FactoryObjectData factData = createFactoryObjectData ( "name" , null ) ; PersistentData persistentData = createPersistentData ( uuid , factData . toByteArray ( ) ) ; String pid = "setMe" ; m_SUT . setPid ( uuid , pid ) ; ArgumentCaptor < Serializable > messageCap = ArgumentCaptor . forClass ( Serializable . class ) ; verify ( persistentData ) . setEntity ( messageCap . capture ( ) ) ; FactoryObjectData updatedFactData = FactoryObjectData . parseFrom ( ( byte [ ] ) messageCap . getValue ( ) ) ; assertThat ( updatedFactData . getPid ( ) , is ( pid ) ) ; }
Verify the expected behavior of setPid() when the factory data exists
 - data should be updated with the given PID
Verify the expected behavior of setPid () when the factory data exists - data should be updated with the given PID
//mock factory object data entity //verify that the persistent data entry is updated with a new version of the factoryObjectData //capture what was set //parse the updated data from the capture //verify that the data has no Pid