mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestRemotePropertyConverter.java
@Test
    public final void testComplexTypesMapToMap_ObservationXml() throws Exception
    {
        byte[] obsXml = new byte[] { 0x01, 0x02, 0x03 };
        
        // mock
        List<ComplexTypesMapEntry> props = new ArrayList<ComplexTypesMapEntry>();
        ComplexTypesMapEntry mapType = ComplexTypesMapEntry.newBuilder().
            setKey("Observation").
            setObservationXml(ByteString.copyFrom(obsXml)).build();
        props.add(mapType);
        
        Observation observation = new Observation().withAssetUuid(UUID.randomUUID()).withSensorId("test sensor");
        when(m_XmlUnmarshalService.getXmlObject(Observation.class, obsXml)).thenReturn(observation);

        Map<String, Object> map = m_SUT.complexTypesMapToMap(props);
        assertThat(map, rawMapHasEntry("Observation", observation));
    }
/**
     * Test converting a complex types map that contains an XML observation to a map with a JAXB observation.
     */
Test converting a complex types map that contains an XML observation to a map with a JAXB observation.
Test converting a complex types map that contains an XML observation to a map with a JAXB observation .
@Test
    public final void testComplexTypesMapToMap_ObservationXml() throws Exception
    {
        byte[] obsXml = new byte[] { 0x01, 0x02, 0x03 };
        List<ComplexTypesMapEntry> props = new ArrayList<ComplexTypesMapEntry>();
        ComplexTypesMapEntry mapType = ComplexTypesMapEntry.newBuilder().
            setKey("Observation").
            setObservationXml(ByteString.copyFrom(obsXml)).build();
        props.add(mapType);
        Observation observation = new Observation().withAssetUuid(UUID.randomUUID()).withSensorId("test sensor");
        when(m_XmlUnmarshalService.getXmlObject(Observation.class, obsXml)).thenReturn(observation);
        Map<String, Object> map = m_SUT.complexTypesMapToMap(props);
        assertThat(map, rawMapHasEntry("Observation", observation));
    }
@ Test public final void testComplexTypesMapToMap_ObservationXml ( ) throws Exception { byte [ ] obsXml = new byte [ ] { 0x01 , 0x02 , 0x03 } ; List < ComplexTypesMapEntry > props = new ArrayList < ComplexTypesMapEntry > ( ) ; ComplexTypesMapEntry mapType = ComplexTypesMapEntry . newBuilder ( ) . setKey ( "Observation" ) . setObservationXml ( ByteString . copyFrom ( obsXml ) ) . build ( ) ; props . add ( mapType ) ; Observation observation = new Observation ( ) . withAssetUuid ( UUID . randomUUID ( ) ) . withSensorId ( "test sensor" ) ; when ( m_XmlUnmarshalService . getXmlObject ( Observation . class , obsXml ) ) . thenReturn ( observation ) ; Map < String , Object > map = m_SUT . complexTypesMapToMap ( props ) ; assertThat ( map , rawMapHasEntry ( "Observation" , observation ) ) ; }
Test converting a complex types map that contains an XML observation to a map with a JAXB observation.
Test converting a complex types map that contains an XML observation to a map with a JAXB observation .
// mock