package com.turreta.soademo.clientservice;

import com.turreta.soademo.common.dto.AppConfigDTO;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;
import org.junit.*;

@RunWith(SpringRunner.class)
@SpringBootTest
public class ComTurretaSoademoClientserviceApplicationTests {

	@Test
	public void contextLoads() {
	}


	@Test
	public void test01() {
		RestTemplate restTemplate = new RestTemplate();

		AppConfigDTO dto = new AppConfigDTO();
		dto.setApplicationName("app-1");
		HttpEntity<AppConfigDTO> request = new HttpEntity<>(dto);

		String fooResourceUrl
				= "http://localhost:8080/get-config-by-name";
		ResponseEntity<AppConfigDTO> response
				= restTemplate.postForEntity(fooResourceUrl,request, AppConfigDTO.class);

		Assert.assertTrue(response.getStatusCode()==HttpStatus.OK);
	}


}

@@ -627,21 +627,78 @@
 %7B%0A%09%7D%0A%0A%0A%09
-@Test
+/*%0A%09 * We are not testing this in github.%0A%09 */%0A%09@Test%0A%09@Ignore
 %0A%09public
@@ -1160,12 +1160,10 @@
 OK);%0A%09%7D%0A
-%0A%0A
 %7D%0A

Update ComTurretaSoademoClientserviceApplicationTests.java