mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestScanForAssetsHelperImpl.java
@Test
    public void testHandlerResponseTypesRequest()
    {
        when(m_MessageFactory.createAssetDirectoryServiceMessage(
                eq(AssetDirectoryServiceMessageType.ScanForNewAssetsRequest), 
                Mockito.any(Message.class))).thenReturn(m_MessageWrapper);
        
        AssetDirectoryServiceNamespace namespaceMsg = AssetDirectoryServiceNamespace.newBuilder()
                .setType(AssetDirectoryServiceMessageType.GetAssetTypesResponse).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.AssetDirectoryService)
                .setNamespaceMessage(namespaceMsg.toByteString()).build();
        Version version = Version.newBuilder().setMajor(0).setMinor(0).build();
        TerraHarvestMessage thMsg = TerraHarvestMessage.newBuilder().setDestId(0).setSourceId(500).setMessageId(5)
                    .setVersion(version).setTerraHarvestPayload(payload.toByteString()).build();
        
        m_SUT.handleResponse(thMsg, payload, namespaceMsg, null);
        
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        
        verify(m_MessageFactory).createAssetDirectoryServiceMessage(
                eq(AssetDirectoryServiceMessageType.ScanForNewAssetsRequest), messageCaptor.capture());
    
        ScanForNewAssetsRequestData request = (ScanForNewAssetsRequestData)messageCaptor.getValue();
        assertThat(request.getProductType(), equalTo(""));
    }
/**
     * Verify that a scan for assets request is sent using the message factory when a get asset types response message
     * is received.
     */
Verify that a scan for assets request is sent using the message factory when a get asset types response message
is received.
Verify that a scan for assets request is sent using the message factory when a get asset types response message is received .
@Test
    public void testHandlerResponseTypesRequest()
    {
        when(m_MessageFactory.createAssetDirectoryServiceMessage(
                eq(AssetDirectoryServiceMessageType.ScanForNewAssetsRequest), 
                Mockito.any(Message.class))).thenReturn(m_MessageWrapper);
        AssetDirectoryServiceNamespace namespaceMsg = AssetDirectoryServiceNamespace.newBuilder()
                .setType(AssetDirectoryServiceMessageType.GetAssetTypesResponse).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.AssetDirectoryService)
                .setNamespaceMessage(namespaceMsg.toByteString()).build();
        Version version = Version.newBuilder().setMajor(0).setMinor(0).build();
        TerraHarvestMessage thMsg = TerraHarvestMessage.newBuilder().setDestId(0).setSourceId(500).setMessageId(5)
                    .setVersion(version).setTerraHarvestPayload(payload.toByteString()).build();
        m_SUT.handleResponse(thMsg, payload, namespaceMsg, null);
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory).createAssetDirectoryServiceMessage(
                eq(AssetDirectoryServiceMessageType.ScanForNewAssetsRequest), messageCaptor.capture());
        ScanForNewAssetsRequestData request = (ScanForNewAssetsRequestData)messageCaptor.getValue();
        assertThat(request.getProductType(), equalTo(""));
    }
@ Test public void testHandlerResponseTypesRequest ( ) { when ( m_MessageFactory . createAssetDirectoryServiceMessage ( eq ( AssetDirectoryServiceMessageType . ScanForNewAssetsRequest ) , Mockito . any ( Message . class ) ) ) . thenReturn ( m_MessageWrapper ) ; AssetDirectoryServiceNamespace namespaceMsg = AssetDirectoryServiceNamespace . newBuilder ( ) . setType ( AssetDirectoryServiceMessageType . GetAssetTypesResponse ) . build ( ) ; TerraHarvestPayload payload = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . AssetDirectoryService ) . setNamespaceMessage ( namespaceMsg . toByteString ( ) ) . build ( ) ; Version version = Version . newBuilder ( ) . setMajor ( 0 ) . setMinor ( 0 ) . build ( ) ; TerraHarvestMessage thMsg = TerraHarvestMessage . newBuilder ( ) . setDestId ( 0 ) . setSourceId ( 500 ) . setMessageId ( 5 ) . setVersion ( version ) . setTerraHarvestPayload ( payload . toByteString ( ) ) . build ( ) ; m_SUT . handleResponse ( thMsg , payload , namespaceMsg , null ) ; ArgumentCaptor < Message > messageCaptor = ArgumentCaptor . forClass ( Message . class ) ; verify ( m_MessageFactory ) . createAssetDirectoryServiceMessage ( eq ( AssetDirectoryServiceMessageType . ScanForNewAssetsRequest ) , messageCaptor . capture ( ) ) ; ScanForNewAssetsRequestData request = ( ScanForNewAssetsRequestData ) messageCaptor . getValue ( ) ; assertThat ( request . getProductType ( ) , equalTo ( "" ) ) ; }
Verify that a scan for assets request is sent using the message factory when a get asset types response message
 is received.
Verify that a scan for assets request is sent using the message factory when a get asset types response message is received .