From 03383be1ba24774d597a5f9dd17ff6c41cf58053 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 6 May 2016 11:59:03 +0100 Subject: [PATCH] Use AssertJ in PropertiesPropertySourceLoaderTests --- .../env/PropertiesPropertySourceLoaderTests.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java b/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java index f5e08c24bf..2ca18e7a00 100644 --- a/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * 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. @@ -21,8 +21,7 @@ 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; +import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link PropertiesPropertySourceLoader}. @@ -35,22 +34,22 @@ public class PropertiesPropertySourceLoaderTests { @Test public void getFileExtensions() throws Exception { - assertThat(this.loader.getFileExtensions(), - equalTo(new String[] { "properties", "xml" })); + 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"), equalTo((Object) "properties")); + 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"), equalTo((Object) "xml")); + assertThat(source.getProperty("test")).isEqualTo("xml"); } }