mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestRemotePropertyConverter.java
@Test
    public final void testComplexTypesMapToMap_BadObs() throws Exception
    {
        // mock
        List<ComplexTypesMapEntry> props = new ArrayList<ComplexTypesMapEntry>();
        ComplexTypesMapEntry mapType = ComplexTypesMapEntry.newBuilder().
            setKey("Observation").
            setObservationNative(TerraHarvestMessageHelper.getProtoObs()).build();
        props.add(mapType);
        
        when(m_Converter.convertToJaxb(Mockito.any(ObservationGen.Observation.class))).
            thenThrow(new ObjectConverterException("object converter fail"));

        try
        {
            m_SUT.complexTypesMapToMap(props);
            fail("Expected exception because of mocking.");
        }
        catch (ObjectConverterException e)
        {
            //expected exception
        }
    }
/**
     * Test creating a property map from a list of google proto message equivalents.
     * 
     * Verify exception as observation fails to convert.
     */
Test creating a property map from a list of google proto message equivalents.

Verify exception as observation fails to convert.
Test creating a property map from a list of google proto message equivalents . Verify exception as observation fails to convert .
@Test
    public final void testComplexTypesMapToMap_BadObs() throws Exception
    {
        List<ComplexTypesMapEntry> props = new ArrayList<ComplexTypesMapEntry>();
        ComplexTypesMapEntry mapType = ComplexTypesMapEntry.newBuilder().
            setKey("Observation").
            setObservationNative(TerraHarvestMessageHelper.getProtoObs()).build();
        props.add(mapType);
        when(m_Converter.convertToJaxb(Mockito.any(ObservationGen.Observation.class))).
            thenThrow(new ObjectConverterException("object converter fail"));
        try
        {
            m_SUT.complexTypesMapToMap(props);
            fail("Expected exception because of mocking.");
        }
        catch (ObjectConverterException e)
        {
        }
    }
@ Test public final void testComplexTypesMapToMap_BadObs ( ) throws Exception { List < ComplexTypesMapEntry > props = new ArrayList < ComplexTypesMapEntry > ( ) ; ComplexTypesMapEntry mapType = ComplexTypesMapEntry . newBuilder ( ) . setKey ( "Observation" ) . setObservationNative ( TerraHarvestMessageHelper . getProtoObs ( ) ) . build ( ) ; props . add ( mapType ) ; when ( m_Converter . convertToJaxb ( Mockito . any ( ObservationGen . Observation . class ) ) ) . thenThrow ( new ObjectConverterException ( "object converter fail" ) ) ; try { m_SUT . complexTypesMapToMap ( props ) ; fail ( "Expected exception because of mocking." ) ; } catch ( ObjectConverterException e ) { } }
Test creating a property map from a list of google proto message equivalents.
Test creating a property map from a list of google proto message equivalents .
// mock //expected exception