/*
 * Copyright 2018 iserge.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.cesiumjs.cs;

import org.cesiumjs.cs.core.providers.CesiumTerrainProvider;

/**
 * @author Serge Silaev aka iSergio <s.serge.b@gmail.com>
 */
public class CesiumTest extends BaseTestCase {

    public void testCreateWorldTerrain() {
        super.beginTest(new Test() {
            @Override
            public void execute() {
                CesiumTerrainProvider terrainProvider = Cesium.createWorldTerrain();
                assertNotNull(terrainProvider);
                assertEquals(false, terrainProvider.requestVertexNormals);
                assertEquals(false, terrainProvider.requestWaterMask);
            }
        });
    }

    public void testCreateWorldTerrain1() {
        super.beginTest(new Test() {
            @Override
            public void execute() {
                Cesium.CreateWorldTerrainOptions options = new Cesium.CreateWorldTerrainOptions();
                options.requestVertexNormals = true;
                options.requestWaterMask = true;
                CesiumTerrainProvider terrainProvider = Cesium.createWorldTerrain(options);
                assertNotNull(terrainProvider);
                assertEquals(options.requestVertexNormals, terrainProvider.requestVertexNormals);
                assertEquals(options.requestWaterMask, terrainProvider.requestWaterMask);
                assertEquals(options.requestVertexNormals, terrainProvider.hasVertexNormals);
                assertEquals(options.requestWaterMask, terrainProvider.hasWaterMask);
            }
        });
    }
}
@@ -671,16 +671,56 @@
 rovider;
+%0Aimport org.cesiumjs.cs.promise.Fulfill;
 %0A%0A/**%0A *
@@ -1937,32 +1937,249 @@
 uestWaterMask);%0A
+                terrainProvider.readyPromise().then(new Fulfill%3CBoolean%3E() %7B%0A                    @Override%0A                    public void onFulfilled(Boolean ready) %7B%0A                        if (ready) %7B%0A            
                 
@@ -2264,32 +2264,44 @@
                 
+      
+      
 assertEquals(opt
@@ -2346,32 +2346,100 @@
 .hasWaterMask);%0A
+                        %7D%0A                    %7D%0A                %7D);%0A
             %7D%0A  

Fix tests