mil.dod.th.ose.config/test/mil/dod/th/ose/config/event/TestConfigurationAdminEventBridge.java
@SuppressWarnings("unchecked")
    private void activateSetup()
    {
        BundleContext context = mock(BundleContext.class);

        //Mock the registration return from the bundle context.
        when(context.registerService(eq(ConfigurationListener.class), Mockito.any(ConfigListener.class), 
                Mockito.any(Dictionary.class))).thenReturn(m_ServiceRegistration);
        
        //Activate the class.
        m_SUT.activate(context);
        
        ArgumentCaptor<ConfigListener> listenerCaptor = ArgumentCaptor.forClass(ConfigListener.class);
        //Verify that the bundle context register service method was called and capture the dictionary that
        //was passed to the registration method.
        verify(context).registerService(eq(ConfigurationListener.class), listenerCaptor.capture(), 
                Mockito.any(Dictionary.class));
        
        m_ConfigListener = listenerCaptor.getValue();
    }
/**
     * Activate the component and set the listener.
     */
Activate the component and set the listener.
Activate the component and set the listener .
@SuppressWarnings("unchecked")
    private void activateSetup()
    {
        BundleContext context = mock(BundleContext.class);
        when(context.registerService(eq(ConfigurationListener.class), Mockito.any(ConfigListener.class), 
                Mockito.any(Dictionary.class))).thenReturn(m_ServiceRegistration);
        m_SUT.activate(context);
        ArgumentCaptor<ConfigListener> listenerCaptor = ArgumentCaptor.forClass(ConfigListener.class);
        verify(context).registerService(eq(ConfigurationListener.class), listenerCaptor.capture(), 
                Mockito.any(Dictionary.class));
        m_ConfigListener = listenerCaptor.getValue();
    }
@ SuppressWarnings ( "unchecked" ) private void activateSetup ( ) { BundleContext context = mock ( BundleContext . class ) ; when ( context . registerService ( eq ( ConfigurationListener . class ) , Mockito . any ( ConfigListener . class ) , Mockito . any ( Dictionary . class ) ) ) . thenReturn ( m_ServiceRegistration ) ; m_SUT . activate ( context ) ; ArgumentCaptor < ConfigListener > listenerCaptor = ArgumentCaptor . forClass ( ConfigListener . class ) ; verify ( context ) . registerService ( eq ( ConfigurationListener . class ) , listenerCaptor . capture ( ) , Mockito . any ( Dictionary . class ) ) ; m_ConfigListener = listenerCaptor . getValue ( ) ; }
Activate the component and set the listener.
Activate the component and set the listener .
//Mock the registration return from the bundle context. //Activate the class. //Verify that the bundle context register service method was called and capture the dictionary that //was passed to the registration method.