urbanairship-core/src/test/java/com/urbanairship/location/LocationRequestOptionsTest.java
@Test
    public void testToJsonValue() {
        LocationRequestOptions options = new LocationRequestOptions.Builder()
                .setPriority(LocationRequestOptions.PRIORITY_LOW_POWER)
                .setMinDistance(44.4f)
                .setMinTime(1111, TimeUnit.MILLISECONDS)
                .create();

        JsonValue value = options.toJsonValue();
        assertEquals(44.4f, value.getMap().get(LocationRequestOptions.MIN_DISTANCE_KEY).getNumber().floatValue());
        assertEquals(1111, value.getMap().get(LocationRequestOptions.MIN_TIME_KEY).getLong(0));
        assertEquals(LocationRequestOptions.PRIORITY_LOW_POWER, value.getMap().get(LocationRequestOptions.PRIORITY_KEY).getInt(-1));
    }
/**
     * Test creating a JsonValue from a LocationRequestOptions instance.
     */
Test creating a JsonValue from a LocationRequestOptions instance.
Test creating a JsonValue from a LocationRequestOptions instance .
@Test
    public void testToJsonValue() {
        LocationRequestOptions options = new LocationRequestOptions.Builder()
                .setPriority(LocationRequestOptions.PRIORITY_LOW_POWER)
                .setMinDistance(44.4f)
                .setMinTime(1111, TimeUnit.MILLISECONDS)
                .create();
        JsonValue value = options.toJsonValue();
        assertEquals(44.4f, value.getMap().get(LocationRequestOptions.MIN_DISTANCE_KEY).getNumber().floatValue());
        assertEquals(1111, value.getMap().get(LocationRequestOptions.MIN_TIME_KEY).getLong(0));
        assertEquals(LocationRequestOptions.PRIORITY_LOW_POWER, value.getMap().get(LocationRequestOptions.PRIORITY_KEY).getInt(-1));
    }
@ Test public void testToJsonValue ( ) { LocationRequestOptions options = new LocationRequestOptions . Builder ( ) . setPriority ( LocationRequestOptions . PRIORITY_LOW_POWER ) . setMinDistance ( 44.4f ) . setMinTime ( 1111 , TimeUnit . MILLISECONDS ) . create ( ) ; JsonValue value = options . toJsonValue ( ) ; assertEquals ( 44.4f , value . getMap ( ) . get ( LocationRequestOptions . MIN_DISTANCE_KEY ) . getNumber ( ) . floatValue ( ) ) ; assertEquals ( 1111 , value . getMap ( ) . get ( LocationRequestOptions . MIN_TIME_KEY ) . getLong ( 0 ) ) ; assertEquals ( LocationRequestOptions . PRIORITY_LOW_POWER , value . getMap ( ) . get ( LocationRequestOptions . PRIORITY_KEY ) . getInt ( - 1 ) ) ; }
Test creating a JsonValue from a LocationRequestOptions instance.
Test creating a JsonValue from a LocationRequestOptions instance .