// Path: src/main/java/com/kroger/oss/snowGlobe/environment/UpstreamAppInfo.java
// public class UpstreamAppInfo {
// 
//     private int containerPort;
// 
//     /**
//      * The named port that traffic should be routed to.
//      *
//      * @return The port number to use when communicating with the container.
//      */
//     public int port() {
//         return containerPort;
//     }
// 
//     public void setPort(int port) {
//         containerPort = port;
//     }
// }


import com.kroger.oss.snowGlobe.environment.UpstreamAppInfo;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/*
 * Snow-Globe
 *
 * Copyright 2017 The Kroger Co.
 *
 * 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 com.kroger.oss.snowGlobe;




public class NginxEnvironmentFileBuilderTest {

    private NginxEnvironmentFileBuilder fileBuilder;

    @Before
    public void setup() {
        fileBuilder = new NginxEnvironmentFileBuilder(new FrameworkProperties());
    }

    @Test
    public void shouldBeAbleToAddUpstreamEntry() {
        final String cluster1 = "cluster1";
        final String cluster2 = "cluster2";
        fileBuilder.addEmptyCluster("http://" + cluster1);
        fileBuilder.addEmptyCluster("http://" + cluster2);
        String clusterFileContents = fileBuilder.buildClusterFileContents();

// Path: src/main/java/com/kroger/oss/snowGlobe/environment/UpstreamAppInfo.java
// public class UpstreamAppInfo {
// 
//     private int containerPort;
// 
//     /**
//      * The named port that traffic should be routed to.
//      *
//      * @return The port number to use when communicating with the container.
//      */
//     public int port() {
//         return containerPort;
//     }
// 
//     public void setPort(int port) {
//         containerPort = port;
//     }
// }


// Path: src/test/java/com/kroger/oss/snowGlobe/NginxEnvironmentFileBuilderTest.java
import com.kroger.oss.snowGlobe.environment.UpstreamAppInfo;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/*
 * Snow-Globe
 *
 * Copyright 2017 The Kroger Co.
 *
 * 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 com.kroger.oss.snowGlobe;




public class NginxEnvironmentFileBuilderTest {

    private NginxEnvironmentFileBuilder fileBuilder;

    @Before
    public void setup() {
        fileBuilder = new NginxEnvironmentFileBuilder(new FrameworkProperties());
    }

    @Test
    public void shouldBeAbleToAddUpstreamEntry() {
        final String cluster1 = "cluster1";
        final String cluster2 = "cluster2";
        fileBuilder.addEmptyCluster("http://" + cluster1);
        fileBuilder.addEmptyCluster("http://" + cluster2);
        String clusterFileContents = fileBuilder.buildClusterFileContents();

        String expectedContents = fileBuilder.buildUpstreamServerEntry(cluster1, new UpstreamAppInfo()) +