class CompanyTemplate extends AbstractTemplate implements CompanyOperations {

	public Company getCompany(int id) {
		return restOperations.getForObject(COMPANY_URL, Company.class, "/" + id, "");
	}

}

class CompanyTemplateTest extends AbstractTemplate {

	@Test
	@Ignore("Ignoring to get a quick snapshot build out...fix later")
	public void getCompany() {

		mockServer.expect(requestTo(CompanyTemplate.COMPANY_URL.replaceFirst("\\{id\\}", "/1337").replaceFirst("\\{filter\\}", "") + "&oauth2_access_token=ACCESS_TOKEN")).andExpect(method(GET))
			.andRespond(withSuccess(new ClassPathResource("company.json", getClass()), MediaType.APPLICATION_JSON));
		Company company = linkedIn.companyOperations().getCompany(1337);
		
		assertEquals(1337, company.getId());
		assertEquals("https://feeds.feedburner.com/LinkedInBlog", company.getBlogRssUrl());
		assertEquals("C", company.getCompanyType().getCode());
		assertEquals("Public Company", company.getCompanyType().getName());
		assertEquals("LinkedIn takes your professional network online, giving you access to people, jobs and opportunities like never before. Built upon trusted connections and relationships, LinkedIn has established the world\u2019s largest and most powerful professional network. Currently, more than 135 million professionals are on LinkedIn, including executives from all five hundred of the Fortune 500 companies, as well as a wide range of household names in technology, financial services, media, consumer packaged goods, entertainment, and numerous other industries. The company is publicly held and has a diversified business model with revenues coming from user subscriptions, advertising sales and hiring solutions.", company.getDescription());
		assertEquals(1, company.getEmailDomains().size());
		assertEquals("linkedin.com", company.getEmailDomains().get(0));
		assertEquals("G", company.getEmployeeCountRange().getCode());
		assertEquals("1001-5000", company.getEmployeeCountRange().getName());
		assertEquals(2003, company.getFoundedYear());
		assertEquals("Internet", company.getIndustry());
		assertEquals(5, company.getLocations().size());
		assertEquals("Mountain View", company.getLocations().get(0).getAddress().getCity());
		assertEquals("94043", company.getLocations().get(0).getAddress().getPostalCode());
		assertEquals("2029 Stierlin Court", company.getLocations().get(0).getAddress().getStreet1());
		assertEquals("(402) 452-2320", company.getLocations().get(1).getContactInfo().getPhone1());
		assertEquals("https://media.linkedin.com/mpr/mpr/p/3/000/0c2/1d7/1894403.png", company.getLogoUrl());
		assertEquals("LinkedIn", company.getName());
		assertEquals(90110, company.getNumFollowers());
		assertEquals(8, company.getSpecialties().size());
		assertEquals("Online Professional Network", company.getSpecialties().get(0));
		assertEquals("https://media.linkedin.com/mpr/mpr/p/2/000/0fe/1b9/26acf51.png", company.getSquareLogoUrl());
		assertEquals("OPR", company.getStatus().getCode());
		assertEquals("Operating", company.getStatus().getName());
		assertEquals("NYS", company.getStockExchange().getCode());
		assertEquals("New York Stock Exchange", company.getStockExchange().getName());
		assertEquals("LNKD", company.getTicker());
		assertEquals("linkedin", company.getTwitterId());
		assertEquals("linkedin", company.getUniversalName());
		assertEquals("https://www.linkedin.com", company.getWebsiteUrl());
	}

}