mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestRemotePropertyConverter.java
@Test
    public final void testMapToComplexTypesMap_ObservationXml() throws Exception
    {
        // mock
        Map<String, Object> props = new HashMap<String, Object>();
        Observation obs = mock(Observation.class);
        props.put("obs", obs);
        
        byte[] expectedBytes = new byte[] {0x12, 0x34, 0x56, 0x78};
        
        when(m_XmlMarshalService.createXmlByteArray(obs, false)).thenReturn(expectedBytes);
        
        List<ComplexTypesMapEntry> complexMap = m_SUT.mapToComplexTypesMap(props, 
                RemoteTypesGen.LexiconFormat.Enum.XML);
        
        // verify
        assertThat(complexMap.get(0).getValueCase(), is(ValueCase.OBSERVATIONXML));
        assertThat(complexMap.get(0).getObservationXml(), is(ByteString.copyFrom(expectedBytes)));
    }
/**
     * Verify observation in map is translated to XML if that is the desired format.
     */
Verify observation in map is translated to XML if that is the desired format.
Verify observation in map is translated to XML if that is the desired format .
@Test
    public final void testMapToComplexTypesMap_ObservationXml() throws Exception
    {
        Map<String, Object> props = new HashMap<String, Object>();
        Observation obs = mock(Observation.class);
        props.put("obs", obs);
        byte[] expectedBytes = new byte[] {0x12, 0x34, 0x56, 0x78};
        when(m_XmlMarshalService.createXmlByteArray(obs, false)).thenReturn(expectedBytes);
        List<ComplexTypesMapEntry> complexMap = m_SUT.mapToComplexTypesMap(props, 
                RemoteTypesGen.LexiconFormat.Enum.XML);
        assertThat(complexMap.get(0).getValueCase(), is(ValueCase.OBSERVATIONXML));
        assertThat(complexMap.get(0).getObservationXml(), is(ByteString.copyFrom(expectedBytes)));
    }
@ Test public final void testMapToComplexTypesMap_ObservationXml ( ) throws Exception { Map < String , Object > props = new HashMap < String , Object > ( ) ; Observation obs = mock ( Observation . class ) ; props . put ( "obs" , obs ) ; byte [ ] expectedBytes = new byte [ ] { 0x12 , 0x34 , 0x56 , 0x78 } ; when ( m_XmlMarshalService . createXmlByteArray ( obs , false ) ) . thenReturn ( expectedBytes ) ; List < ComplexTypesMapEntry > complexMap = m_SUT . mapToComplexTypesMap ( props , RemoteTypesGen . LexiconFormat . Enum . XML ) ; assertThat ( complexMap . get ( 0 ) . getValueCase ( ) , is ( ValueCase . OBSERVATIONXML ) ) ; assertThat ( complexMap . get ( 0 ) . getObservationXml ( ) , is ( ByteString . copyFrom ( expectedBytes ) ) ) ; }
Verify observation in map is translated to XML if that is the desired format.
Verify observation in map is translated to XML if that is the desired format .
// mock // verify