From: Gustavo Martin Morcuende Date: Sat, 24 Dec 2016 00:48:59 +0000 (+0100) Subject: Improving test X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=99989f58b398b91b1b18a79ffce2a0b11f6c9bea;p=JavaForFun Improving test --- diff --git a/SpringJava/JPA/spring-jpa-persistence/src/test/java/de/spring/example/persitence/domain/AdTest.java b/SpringJava/JPA/spring-jpa-persistence/src/test/java/de/spring/example/persitence/domain/AdTest.java index eae39d3..466a631 100644 --- a/SpringJava/JPA/spring-jpa-persistence/src/test/java/de/spring/example/persitence/domain/AdTest.java +++ b/SpringJava/JPA/spring-jpa-persistence/src/test/java/de/spring/example/persitence/domain/AdTest.java @@ -1,6 +1,7 @@ package de.spring.example.persitence.domain; -import static org.junit.Assert.assertEquals; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import java.time.OffsetDateTime; import java.util.HashSet; @@ -34,12 +35,13 @@ public class AdTest { public void whenCallingConstructorWithParametersThenCreateObject() { Ad ad = createAd(); - assertEquals(ad.getAdDescriptions(), AD_DESCRIPTIONS); - assertEquals(ad.getAdMobileImage(), AD_MOBILE_IMAGE); - assertEquals(ad.getCompanyCategId(), COMPANY_CATEG_ID); - assertEquals(ad.getCreatedAt(), CREATED_AT); - assertEquals(ad.getUpdatedAt(), UPDATED_AT); - assertEquals(ad.getId(), AD_ID); + assertThat(ad.getAdDescriptions(), is(AD_DESCRIPTIONS)); + assertThat(ad.getAdMobileImage(), is(AD_MOBILE_IMAGE)); + assertThat(ad.getCompanyCategId(), is(COMPANY_CATEG_ID)); + assertThat(ad.getCompanyId(), is(COMPANY_ID)); + assertThat(ad.getCreatedAt(), is(CREATED_AT)); + assertThat(ad.getUpdatedAt(), is(UPDATED_AT)); + assertThat(ad.getId(), is(AD_ID)); } private static final Ad createAd() {