package com.sap.mentors.lemonaid.utils;

import static org.junit.Assert.*;

import org.junit.Test;

import com.sap.mentors.lemonaid.entities.Country;
import com.sap.mentors.lemonaid.entities.Mentor;
import com.sap.mentors.lemonaid.utils.types.Point;

public class MentorUtilsTest {

	@Test
	public void testGeocodingForGermany() {
		Mentor mentor = new Mentor();
		mentor.setAddress1("Hasso-Plattner-Ring 7");
		mentor.setCity("Walldorf");
		mentor.setZip("69190");
		Country countryId = new Country("DE");
		mentor.setCountryId(countryId);
		MentorUtils mentorUtils = new MentorUtils();
		Point point = mentorUtils.getLocationOfMentor(mentor);
		double lat = new Double(49.2944697);
		double lon = new Double(8.6367358);
		assertEquals(lat, point.getLatitude(), 0.001);
		assertEquals(lon, point.getLongitude(), 0.001);
	}
	@Test
	public void testGeocodingForMalaysia() {
		Mentor mentor = new Mentor();
		mentor.setAddress1("A-09-03 Casa Desa Condominium,1 Jalan Desa Utama");
		mentor.setAddress2("Taman Desa");
		mentor.setCity("Kuala Lumpur");
		mentor.setState("Wilayah Persekutuan Kuala Lumpur");
		mentor.setZip("58100");
		Country countryId = new Country("MY");
		mentor.setCountryId(countryId);
		MentorUtils mentorUtils = new MentorUtils();
		Point point = mentorUtils.getLocationOfMentor(mentor);
		double lat = new Double(3.1088357);
		double lon = new Double(101.6861987);
		assertEquals(lat, point.getLatitude(), 0.001);
		assertEquals(lon, point.getLongitude(), 0.001);
	}
}

@@ -924,92 +924,40 @@
 s1(%22
-A-09-03 Casa Desa Condominium,1 Jalan Desa Utama%22);%0A%09%09mentor.setAddress2(%22Taman Desa
+22, Gtower, 199, Jalan Tun Razak
 %22);%0A
@@ -1067,11 +1067,11 @@
 p(%225
-810
+045
 0%22);
@@ -1283,14 +1283,14 @@
 (3.1
-088357
+589771
 );%0A%09
@@ -1322,15 +1322,14 @@
 101.
-6861987
+719424
 );%0A%09

Use address of SAP Malaysia #23