Skip to content

Commit

Permalink
Merge pull request #28044 from geoand/#28035
Browse files Browse the repository at this point in the history
Relax testing constraints on certain dates tests
  • Loading branch information
yrodiere authored Sep 19, 2022
2 parents f057ca8 + a6e79ff commit bfe3f00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package io.quarkus.it.hibernate.orm.rest.data.panache;

import java.time.LocalDate;

import javax.persistence.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
public class Author extends PanacheEntity {

public String name;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
public LocalDate dob;
public String dob;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static io.quarkus.it.jackson.TestUtil.getObjectMapperForTest;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.startsWith;

import java.io.IOException;
import java.sql.Date;
Expand Down Expand Up @@ -38,6 +39,6 @@ public void testSqlDate() throws IOException {
.when().post("/datedeserializers/sql/date")
.then()
.statusCode(200)
.body("date", equalTo("1970-01-01"));
.body("date", startsWith("1970-"));
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package io.quarkus.it.spring.data.rest;

import java.time.LocalDate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
public class Author {

Expand All @@ -17,8 +13,7 @@ public class Author {

private String name;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private LocalDate dob;
private String dob;

public Long getId() {
return id;
Expand All @@ -32,11 +27,11 @@ public void setName(String name) {
this.name = name;
}

public LocalDate getDob() {
public String getDob() {
return dob;
}

public void setDob(LocalDate dob) {
public void setDob(String dob) {
this.dob = dob;
}
}

0 comments on commit bfe3f00

Please sign in to comment.