mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryRegistry.java
@Test
    public void testPersistObjectDataNoRename() throws IllegalArgumentException, FactoryObjectInformationException
    {
        String name = "NoChangeNeeded";
        UUID uuid = UUID.randomUUID();

        //when the name is checked for associate it with the given uuid
        when(this.m_FactoryObjectDataManager.getPersistentUuid(name)).thenReturn(uuid);

        m_SUT.persistNewObjectData(name, uuid, m_FactoryDescriptor, false);

        //verify name was not persisted because it is already stored with the correct uuid in the datastore
        verify(m_FactoryObjectDataManager, Mockito.never()).persistNewObjectData(uuid, m_FactoryDescriptor, name);
    }
/**
     * Test that data isn't re-persisted if the name is already associated with the uuid
     */
Test that data isn't re-persisted if the name is already associated with the uuid
Test that data isn ' t re - persisted if the name is already associated with the uuid
@Test
    public void testPersistObjectDataNoRename() throws IllegalArgumentException, FactoryObjectInformationException
    {
        String name = "NoChangeNeeded";
        UUID uuid = UUID.randomUUID();
        when(this.m_FactoryObjectDataManager.getPersistentUuid(name)).thenReturn(uuid);
        m_SUT.persistNewObjectData(name, uuid, m_FactoryDescriptor, false);
        verify(m_FactoryObjectDataManager, Mockito.never()).persistNewObjectData(uuid, m_FactoryDescriptor, name);
    }
@ Test public void testPersistObjectDataNoRename ( ) throws IllegalArgumentException , FactoryObjectInformationException { String name = "NoChangeNeeded" ; UUID uuid = UUID . randomUUID ( ) ; when ( this . m_FactoryObjectDataManager . getPersistentUuid ( name ) ) . thenReturn ( uuid ) ; m_SUT . persistNewObjectData ( name , uuid , m_FactoryDescriptor , false ) ; verify ( m_FactoryObjectDataManager , Mockito . never ( ) ) . persistNewObjectData ( uuid , m_FactoryDescriptor , name ) ; }
Test that data isn't re-persisted if the name is already associated with the uuid
Test that data isn ' t re - persisted if the name is already associated with the uuid
//when the name is checked for associate it with the given uuid //verify name was not persisted because it is already stored with the correct uuid in the datastore