mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsLayerTypesMgrImpl.java
@Test
    public void testCapabilitiesHandlerErrorResponse() throws ObjectConverterException
    {
        CapabilitiesResponseHandler handler = m_SUT.new CapabilitiesResponseHandler("class.name.one");
        
        //response message to process
        GenericErrorResponseData responseData = GenericErrorResponseData.newBuilder().
            setError(ErrorCode.ILLEGAL_STATE).setErrorDescription("some description").build();
                
        BaseNamespace nameResponse = BaseNamespace.newBuilder().
            setData(responseData.toByteString()).
            setType(BaseMessageType.GenericErrorResponse).build();

        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.Base).
            setNamespaceMessage(responseData.toByteString()).build();  
            
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.Base, 123, nameResponse);
        
        when(m_Converter.convertToJaxb(Mockito.any(Message.class))).thenThrow(new ObjectConverterException(""));
        
        handler.handleResponse(thMessage, payload, nameResponse, responseData);
        
        verify(m_GrowlUtil).createGlobalFacesMessage(eq(FacesMessage.SEVERITY_ERROR), 
                eq("Capabilities Retrieval Error"),
                eq("An error (ILLEGAL_STATE) occurred trying to retrieve capabilities for comm type" + 
                   " [class.name.one]: some description"));
    }
/**
     * Verify error response is handled for a capabilities response handler.
     */
Verify error response is handled for a capabilities response handler.
Verify error response is handled for a capabilities response handler .
@Test
    public void testCapabilitiesHandlerErrorResponse() throws ObjectConverterException
    {
        CapabilitiesResponseHandler handler = m_SUT.new CapabilitiesResponseHandler("class.name.one");
        GenericErrorResponseData responseData = GenericErrorResponseData.newBuilder().
            setError(ErrorCode.ILLEGAL_STATE).setErrorDescription("some description").build();
        BaseNamespace nameResponse = BaseNamespace.newBuilder().
            setData(responseData.toByteString()).
            setType(BaseMessageType.GenericErrorResponse).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.Base).
            setNamespaceMessage(responseData.toByteString()).build();  
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.Base, 123, nameResponse);
        when(m_Converter.convertToJaxb(Mockito.any(Message.class))).thenThrow(new ObjectConverterException(""));
        handler.handleResponse(thMessage, payload, nameResponse, responseData);
        verify(m_GrowlUtil).createGlobalFacesMessage(eq(FacesMessage.SEVERITY_ERROR), 
                eq("Capabilities Retrieval Error"),
                eq("An error (ILLEGAL_STATE) occurred trying to retrieve capabilities for comm type" + 
                   " [class.name.one]: some description"));
    }
@ Test public void testCapabilitiesHandlerErrorResponse ( ) throws ObjectConverterException { CapabilitiesResponseHandler handler = m_SUT . new CapabilitiesResponseHandler ( "class.name.one" ) ; GenericErrorResponseData responseData = GenericErrorResponseData . newBuilder ( ) . setError ( ErrorCode . ILLEGAL_STATE ) . setErrorDescription ( "some description" ) . build ( ) ; BaseNamespace nameResponse = BaseNamespace . newBuilder ( ) . setData ( responseData . toByteString ( ) ) . setType ( BaseMessageType . GenericErrorResponse ) . build ( ) ; TerraHarvestPayload payload = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . Base ) . setNamespaceMessage ( responseData . toByteString ( ) ) . build ( ) ; TerraHarvestMessage thMessage = TerraHarvestMessageHelper . createTerraHarvestMessage ( systemId1 , 0 , Namespace . Base , 123 , nameResponse ) ; when ( m_Converter . convertToJaxb ( Mockito . any ( Message . class ) ) ) . thenThrow ( new ObjectConverterException ( "" ) ) ; handler . handleResponse ( thMessage , payload , nameResponse , responseData ) ; verify ( m_GrowlUtil ) . createGlobalFacesMessage ( eq ( FacesMessage . SEVERITY_ERROR ) , eq ( "Capabilities Retrieval Error" ) , eq ( "An error (ILLEGAL_STATE) occurred trying to retrieve capabilities for comm type" + " [class.name.one]: some description" ) ) ; }
Verify error response is handled for a capabilities response handler.
Verify error response is handled for a capabilities response handler .
//response message to process