mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestTemplateProgramManagerImpl.java
@Test
    public void testGetTemplateNames() throws IllegalArgumentException, PersistenceFailedException
    {
        //mock the stored templates
        mockTemplateProgramManagerTemplates();
        m_SUT.activate(context);
    
        Set<String> names = m_SUT.getMissionTemplateNames();
        //check that all templates are here
        assertThat(names, hasItem("saved-program1"));
        assertThat(names, hasItem("saved-program2"));
        assertThat(names, hasItem("saved-program3"));
        assertThat(names, hasItem("saved-program4"));
        assertThat(names, hasItem("saved-program5"));
        
        MissionProgramTemplate template = new MissionProgramTemplate().withDescription("I'm a newb").
            withName("RockStar").withSource("wellOfCourse");
        m_SUT.loadMissionTemplate(template);
        verify(m_PersistentDataStore).persist(eq(TemplateProgramManagerImpl.class), Mockito.any(UUID.class), 
            eq("RockStar"), (Serializable)Mockito.any());
        
        //verify new template added and that its name is in the list
        names = m_SUT.getMissionTemplateNames();
        assertThat(names, hasItem("RockStar"));
    }
/**
     * Test the return of all template names.
     */
Test the return of all template names.
Test the return of all template names .
@Test
    public void testGetTemplateNames() throws IllegalArgumentException, PersistenceFailedException
    {
        mockTemplateProgramManagerTemplates();
        m_SUT.activate(context);
        Set<String> names = m_SUT.getMissionTemplateNames();
        assertThat(names, hasItem("saved-program1"));
        assertThat(names, hasItem("saved-program2"));
        assertThat(names, hasItem("saved-program3"));
        assertThat(names, hasItem("saved-program4"));
        assertThat(names, hasItem("saved-program5"));
        MissionProgramTemplate template = new MissionProgramTemplate().withDescription("I'm a newb").
            withName("RockStar").withSource("wellOfCourse");
        m_SUT.loadMissionTemplate(template);
        verify(m_PersistentDataStore).persist(eq(TemplateProgramManagerImpl.class), Mockito.any(UUID.class), 
            eq("RockStar"), (Serializable)Mockito.any());
        names = m_SUT.getMissionTemplateNames();
        assertThat(names, hasItem("RockStar"));
    }
@ Test public void testGetTemplateNames ( ) throws IllegalArgumentException , PersistenceFailedException { mockTemplateProgramManagerTemplates ( ) ; m_SUT . activate ( context ) ; Set < String > names = m_SUT . getMissionTemplateNames ( ) ; assertThat ( names , hasItem ( "saved-program1" ) ) ; assertThat ( names , hasItem ( "saved-program2" ) ) ; assertThat ( names , hasItem ( "saved-program3" ) ) ; assertThat ( names , hasItem ( "saved-program4" ) ) ; assertThat ( names , hasItem ( "saved-program5" ) ) ; MissionProgramTemplate template = new MissionProgramTemplate ( ) . withDescription ( "I'm a newb" ) . withName ( "RockStar" ) . withSource ( "wellOfCourse" ) ; m_SUT . loadMissionTemplate ( template ) ; verify ( m_PersistentDataStore ) . persist ( eq ( TemplateProgramManagerImpl . class ) , Mockito . any ( UUID . class ) , eq ( "RockStar" ) , ( Serializable ) Mockito . any ( ) ) ; names = m_SUT . getMissionTemplateNames ( ) ; assertThat ( names , hasItem ( "RockStar" ) ) ; }
Test the return of all template names.
Test the return of all template names .
//mock the stored templates //check that all templates are here //verify new template added and that its name is in the list