<commit_before>/*
 * Copyright 2012-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.env;

import org.junit.Test;

import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ClassPathResource;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

/**
 * Tests for {@link PropertiesPropertySourceLoader}.
 *
 * @author <NAME>
 */
public class PropertiesPropertySourceLoaderTests {

	private PropertiesPropertySourceLoader loader = new PropertiesPropertySourceLoader();

	@Test
	public void getFileExtensions() throws Exception {
		assertThat(this.loader.getFileExtensions(),
				equalTo(new String[] { "properties", "xml" }));
	}

	@Test
	public void loadProperties() throws Exception {
		PropertySource<?> source = this.loader.load("test.properties",
				new ClassPathResource("test-properties.properties", getClass()), null);
		assertThat(source.getProperty("test"), equalTo((Object) "properties"));
	}

	@Test
	public void loadXml() throws Exception {
		PropertySource<?> source = this.loader.load("test.xml",
				new ClassPathResource("test-xml.xml", getClass()), null);
		assertThat(source.getProperty("test"), equalTo((Object) "xml"));
	}

}<commit_msg>Use AssertJ in PropertiesPropertySourceLoaderTests<commit_after>/*
 * Copyright 2012-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.env;

import org.junit.Test;

import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ClassPathResource;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Tests for {@link PropertiesPropertySourceLoader}.
 *
 * @author <NAME>
 */
public class PropertiesPropertySourceLoaderTests {

	private PropertiesPropertySourceLoader loader = new PropertiesPropertySourceLoader();

	@Test
	public void getFileExtensions() throws Exception {
		assertThat(this.loader.getFileExtensions())
				.isEqualTo(new String[] { "properties", "xml" });
	}

	@Test
	public void loadProperties() throws Exception {
		PropertySource<?> source = this.loader.load("test.properties",
				new ClassPathResource("test-properties.properties", getClass()), null);
		assertThat(source.getProperty("test")).isEqualTo("properties");
	}

	@Test
	public void loadXml() throws Exception {
		PropertySource<?> source = this.loader.load("test.xml",
				new ClassPathResource("test-xml.xml", getClass()), null);
		assertThat(source.getProperty("test")).isEqualTo("xml");
	}

}
{'fraction_non_alphanumeric': 0.11034100360410314, 'fraction_numerical': 0.006653728860548933, 'mean_word_length': 4.924466338259442, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '3026059', 'n_tokens_mistral': 991, 'n_tokens_neox': 949, 'n_words': 310}