package com.orange.oss.cloudfoundry.cscpi;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = BoshCloudstackCpiCoreApplication.class)

public class UserDataGeneratorTest {

	@Autowired
	UserDataGenerator generator;
	
	@Test
	public void testUserDataGeneration() {
		String userData=this.generator.vmMetaData();
	}

}

@@ -333,16 +333,193 @@
 unner;%0A%0A
+import com.orange.oss.cloudfoundry.cscpi.domain.Network;%0Aimport com.orange.oss.cloudfoundry.cscpi.domain.NetworkType;%0Aimport com.orange.oss.cloudfoundry.cscpi.domain.Networks;%0A%0A
 %0A@RunWit
@@ -762,16 +762,408 @@
 tion() %7B
+%0A%0A%09%09Networks networks=new Networks();%0A%09%09Network net=new Network();%0A%09%09networks.networks.put(%22default%22, net);%0A%09%09//net.type=NetworkType.dynamic;%0A%09%09net.type=NetworkType.manual;%0A%09%09net.ip=%2210.234.228.158%22;%0A%09%09net.gateway=%2210.234.228.129%22;%0A%09%09net.netmask=%22255.255.255.192%22;%0A%09%09net.cloud_properties.put(%22name%22, %223112 - preprod - back%22);%0A%09%09net.dns.add(%2210.234.50.180%22);%0A%09%09net.dns.add(%2210.234.71.124%22);%0A%09%09
 %0A%09%09Strin
@@ -1199,16 +1199,24 @@
 etaData(
+networks
 );%0A%09%7D%0A%0A%7D

add cloud properties dns config to be set in cloudstack userData update TODO