mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/observation/TestObservationMessageService.java
private ObservationQuery mockObservationQueryExecute(UUID assetUuid, String type, ObservationSubTypeEnum subtype,
            Date start, Date stop, Date observedStart, Date observedStop, ObservationQuery.SortField field,
            ObservationQuery.SortOrder order, Integer startRange, Integer endRange, Integer maxObs,
            List<Observation> obs)
    {
        ObservationQuery query = mockObservationQuery(assetUuid, type, subtype, start, stop, observedStart, 
                observedStop, maxObs);
        
        if (field != null && order != null)
        {
            when(query.withOrder(field, order)).thenReturn(query);
        }
        
        if (startRange != null && endRange != null)
        {
            when(query.withRange(startRange, endRange)).thenReturn(query);
        }
        
        when(query.execute()).thenReturn(obs);
        
        return query;
    }
/**
     * Mocks an ObservationQuery based on the inputs given and makes sure that the mocked object is returned
     * from the observation store when m_ObservationStore.newQuery() is called. Also ensures that the 
     * observation list passed in is returned when query.execute() is called. If a field is not to be set 
     * then null should be passed to the method. This method makes no checks on what are 
     * the valid combinations of query fields. 
     * 
     * @param assetUuid
     *  uuid of the asset; null if it is not to be set
     * @param type
     *  the type of the asset; null if it is not to be set
     * @param start
     *  the start date object for the created time range; null if not to be set
     * @param stop
     *  the stop date object for the created time range; null if not to be set
     * @param observedStart
     *  the start date object for the observed time range; null if not to be set
     * @param observedStop
     *  the stop date object for the observed time range; null if not to be set
     * @param field
     *  the sorting field of the query
     * @param order
     *  the sorting order of the query
     * @param startRange
     *  the start of the range of observations to return
     * @param endRange
     *  the end of the range of observations to return
     * @param maxObs
     *  the max number of observations; null if not to be set
     * @param obs
     *  the observations that should be returned when query.execute() is called.
     * @return
     *  the mocked observation query object
     */
Mocks an ObservationQuery based on the inputs given and makes sure that the mocked object is returned
from the observation store when m_ObservationStore.newQuery() is called. Also ensures that the
observation list passed in is returned when query.execute() is called. If a field is not to be set
then null should be passed to the method. This method makes no checks on what are
the valid combinations of query fields.


Mocks an ObservationQuery based on the inputs given and makes sure that the mocked object is returned from the observation store when m_ObservationStore . newQuery () is called . Also ensures that the observation list passed in is returned when query . execute () is called . If a field is not to be set then null should be passed to the method . This method makes no checks on what are the valid combinations of query fields .
private ObservationQuery mockObservationQueryExecute(UUID assetUuid, String type, ObservationSubTypeEnum subtype,
            Date start, Date stop, Date observedStart, Date observedStop, ObservationQuery.SortField field,
            ObservationQuery.SortOrder order, Integer startRange, Integer endRange, Integer maxObs,
            List<Observation> obs)
    {
        ObservationQuery query = mockObservationQuery(assetUuid, type, subtype, start, stop, observedStart, 
                observedStop, maxObs);
        if (field != null && order != null)
        {
            when(query.withOrder(field, order)).thenReturn(query);
        }
        if (startRange != null && endRange != null)
        {
            when(query.withRange(startRange, endRange)).thenReturn(query);
        }
        when(query.execute()).thenReturn(obs);
        return query;
    }
private ObservationQuery mockObservationQueryExecute ( UUID assetUuid , String type , ObservationSubTypeEnum subtype , Date start , Date stop , Date observedStart , Date observedStop , ObservationQuery . SortField field , ObservationQuery . SortOrder order , Integer startRange , Integer endRange , Integer maxObs , List < Observation > obs ) { ObservationQuery query = mockObservationQuery ( assetUuid , type , subtype , start , stop , observedStart , observedStop , maxObs ) ; if ( field != null && order != null ) { when ( query . withOrder ( field , order ) ) . thenReturn ( query ) ; } if ( startRange != null && endRange != null ) { when ( query . withRange ( startRange , endRange ) ) . thenReturn ( query ) ; } when ( query . execute ( ) ) . thenReturn ( obs ) ; return query ; }
Mocks an ObservationQuery based on the inputs given and makes sure that the mocked object is returned
 from the observation store when m_ObservationStore.newQuery() is called.
Mocks an ObservationQuery based on the inputs given and makes sure that the mocked object is returned from the observation store when m_ObservationStore . newQuery () is called .