mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testPersistNewObjectData() throws FactoryObjectInformationException, IllegalArgumentException, 
        PersistenceFailedException, InvalidProtocolBufferException
    {
        //the name to use
        String name = "name";
        //the uuid
        UUID uuid = UUID.randomUUID();
        //factory
        FactoryDescriptor factory = FactoryMocker.mockFactoryDescriptor(PRODUCT_TYPE);

        //call to set a name
        m_SUT.persistNewObjectData(uuid, factory, name);
        
        //verify
        ArgumentCaptor<Serializable> entityCap = ArgumentCaptor.forClass(Serializable.class);
        verify(m_PersistentDataStore).
            persist(eq(LinkLayer.class), eq(uuid), eq(PRODUCT_TYPE), entityCap.capture());
        
        FactoryObjectData createdData = FactoryObjectData.parseFrom((byte[])entityCap.getValue());
        assertThat(createdData.getName(), is(name));
    }
/**
     * Verify behavior of persistNewObjectData.
     * - given a unique UUID and valid information, a new persisted data entry should be
     *   created in the data store
     */
Verify behavior of persistNewObjectData.
- given a unique UUID and valid information, a new persisted data entry should be
created in the data store
Verify behavior of persistNewObjectData . - given a unique UUID and valid information a new persisted data entry should be created in the data store
@Test
    public void testPersistNewObjectData() throws FactoryObjectInformationException, IllegalArgumentException, 
        PersistenceFailedException, InvalidProtocolBufferException
    {
        String name = "name";
        UUID uuid = UUID.randomUUID();
        FactoryDescriptor factory = FactoryMocker.mockFactoryDescriptor(PRODUCT_TYPE);
        m_SUT.persistNewObjectData(uuid, factory, name);
        ArgumentCaptor<Serializable> entityCap = ArgumentCaptor.forClass(Serializable.class);
        verify(m_PersistentDataStore).
            persist(eq(LinkLayer.class), eq(uuid), eq(PRODUCT_TYPE), entityCap.capture());
        FactoryObjectData createdData = FactoryObjectData.parseFrom((byte[])entityCap.getValue());
        assertThat(createdData.getName(), is(name));
    }
@ Test public void testPersistNewObjectData ( ) throws FactoryObjectInformationException , IllegalArgumentException , PersistenceFailedException , InvalidProtocolBufferException { String name = "name" ; UUID uuid = UUID . randomUUID ( ) ; FactoryDescriptor factory = FactoryMocker . mockFactoryDescriptor ( PRODUCT_TYPE ) ; m_SUT . persistNewObjectData ( uuid , factory , name ) ; ArgumentCaptor < Serializable > entityCap = ArgumentCaptor . forClass ( Serializable . class ) ; verify ( m_PersistentDataStore ) . persist ( eq ( LinkLayer . class ) , eq ( uuid ) , eq ( PRODUCT_TYPE ) , entityCap . capture ( ) ) ; FactoryObjectData createdData = FactoryObjectData . parseFrom ( ( byte [ ] ) entityCap . getValue ( ) ) ; assertThat ( createdData . getName ( ) , is ( name ) ) ; }
Verify behavior of persistNewObjectData.
Verify behavior of persistNewObjectData .
//the name to use //the uuid //factory //call to set a name //verify