From 99989f58b398b91b1b18a79ffce2a0b11f6c9bea Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sat, 24 Dec 2016 01:48:59 +0100 Subject: [PATCH] Improving test --- .../java/de/spring/example/persitence/domain/AdTest.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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() { -- 2.1.4