<commit_before>package com.webservice.steps;

import javax.xml.bind.JAXBException;

import org.jbehave.core.annotations.Given;
import org.jbehave.core.annotations.Named;
import org.jbehave.core.annotations.Then;
import org.jbehave.core.annotations.When;
import org.junit.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.webservice.client.GlobalWeatherClient;
import com.webservice.utils.WebServiceUtils;

/**
 * @since 25-05-2015
 * @author leonardo.pereira
 * Global Weather Service Steps
 */

@Component
public class GlobalWeatherSteps {   
	
	private String currentWeather;
	private String response;
	private String country;
	private String city;
	
	@Autowired private GlobalWeatherClient weatherClient;
	
	@Autowired private WebServiceUtils webServiceUtils;
	
	/**
	 * Prepare data between steps
	 * @param countryName
	 * @param cityName
	 */
	@Given("A country $countryName and city $cityName")
	public void doPrepareData(@Named("countryName") String countryName, @Named("cityName") String cityName) {
		country = countryName;
		city = cityName;
	}

	/**
	 * Call service
	 * @throws JAXBException
	 */
	@When("I consume GetWeather service")
	public void doCallService() throws JAXBException {
		response = weatherClient.getWeather(country, city);
		currentWeather = webServiceUtils.findTagValue(response, "Temperature"); 
	}

	/**
	 * Verify results
	 * @param temperture
	 */
	@Then("Verify that temperature is $temperture")
	public void verifyTemperature(@Named("temperture") String temperture) {
		Assert.assertTrue(currentWeather.contains(temperture));
	}

}<commit_msg>Update GlobalWeatherSteps.java<commit_after>package com.webservice.steps;

import javax.xml.bind.JAXBException;

import org.jbehave.core.annotations.Given;
import org.jbehave.core.annotations.Named;
import org.jbehave.core.annotations.Then;
import org.jbehave.core.annotations.When;
import org.junit.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.webservice.client.GlobalWeatherClient;
import com.webservice.utils.WebServiceUtils;

/**
 * @since 25-05-2015
 * @author leonardo.pereira
 * Global Weather Service Steps
 */

@Component
public class GlobalWeatherSteps {   
	
	private String currentWeather;
	private String response;
	private String country;
	private String city;
	
	@Autowired private GlobalWeatherClient weatherClient;
	
	@Autowired private WebServiceUtils webServiceUtils;
	
	/**
	 * Prepare data between steps
	 * @param countryName
	 * @param cityName
	 */
	@Given("A country $countryName and city $cityName")
	public void doPrepareData(@Named("countryName") String countryName, @Named("cityName") String cityName) {
		country = countryName;
		city = cityName;
	}

	/**
	 * Call service
	 * @throws JAXBException
	 */
	@When("I consume GetWeather service")
	public void doCallService() throws JAXBException {
		response = weatherClient.getWeather(country, city);
		currentWeather = webServiceUtils.findTagValue(response, "Temperature"); 
	}

	/**
	 * Verify results
	 * @param temperture
	 */
	@Then("Verify that temperature is $temperture")
	public void verifyTemperature(@Named("temperture") String temperture) {
		Assert.assertTrue(currentWeather.contains("C"));
	}

}
{'fraction_non_alphanumeric': 0.10395446375074895, 'fraction_numerical': 0.004793289394847214, 'mean_word_length': 5.217877094972067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6269664', 'n_tokens_mistral': 1044, 'n_tokens_neox': 986, 'n_words': 229}