io.mesosphere.mesos.frameworks.cassandra.scheduler.api.ConfigControllerTest.java Source code

Java tutorial

Introduction

Here is the source code for io.mesosphere.mesos.frameworks.cassandra.scheduler.api.ConfigControllerTest.java

Source

/**
 *    Copyright (C) 2015 Mesosphere, Inc.
 *
 * 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 io.mesosphere.mesos.frameworks.cassandra.scheduler.api;

import com.fasterxml.jackson.databind.JsonNode;
import io.mesosphere.mesos.util.Tuple2;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;

public class ConfigControllerTest extends AbstractApiControllerTest {

    @Test
    public void testConfig() throws Exception {
        final Tuple2<Integer, JsonNode> tup = fetchJson("/config", false);
        assertEquals(200, tup._1.intValue());
        final JsonNode json = tup._2;

        assertEquals("test-cluster", json.get("frameworkName").asText());
        assertThat(json.get("frameworkId").asText()).isNotEmpty();
        assertEquals(9042, json.get("nativePort").asInt());
        assertEquals(9160, json.get("rpcPort").asInt());
    }
}