PAN-52 Fixed issue with the Theorems API

This commit is contained in:
2019-03-21 11:29:30 -06:00
parent c9a2a978fc
commit f5dbdac990
4 changed files with 6 additions and 1 deletions
@@ -41,7 +41,6 @@ CREATE TABLE proofs
proof VARCHAR(4096) NOT NULL,
branch VARCHAR(512) NOT NULL,
theorem INT NOT NULL,
FOREIGN KEY fk_theorem (theorem) REFERENCES theorems (id) ON DELETE NO ACTION ON UPDATE NO ACTION,
referenced_definitions JSON,
referenced_theorems JSON,
date_added DATE,
@@ -34,6 +34,7 @@ public class ProofsIntegrationTest {
assertEquals("Test proof", savedProof.getTheoremName());
assertEquals("Test branch", savedProof.getBranch());
assertEquals("test", savedProof.getProof());
assertEquals(Integer.valueOf(1), savedProof.getTheorem());
assertNotNull(savedProof.getDateCreated());
assertNotNull(savedProof.getLastUpdated());
assertEquals(2, savedProof.getReferencedTheorems().size());
@@ -52,6 +53,7 @@ public class ProofsIntegrationTest {
assertEquals("Test proof", updatedProof.getTheoremName());
assertEquals("Test Update", updatedProof.getBranch());
assertEquals("test", updatedProof.getProof());
assertEquals(Integer.valueOf(1), savedProof.getTheorem());
assertNotNull(updatedProof.getLastUpdated());
assertNotNull(updatedProof.getDateCreated());
assertNotEquals(updatedProof.getDateCreated().toInstant(), updatedProof.getLastUpdated().toInstant());
@@ -80,6 +82,7 @@ public class ProofsIntegrationTest {
final Proof proof = new Proof();
proof.setTheoremName("Test proof");
proof.setProof("test");
proof.setTheorem(1);
proof.setBranch("Test branch");
proof.setDateCreated(new Date());
proof.setReferencedTheorems(referencedTheoremsList);
@@ -26,6 +26,8 @@ public class Proof extends BaseDto implements Serializable {
@NotNull(groups = Insert.class)
@Size(min = 1, max = 4096, message = "The proof must be at least 1 character and at most 4096 characters")
private String proof;
@NotNull(groups = Insert.class)
private Integer theorem;
@NotBlank(groups = Insert.class)
@Size(min = 1, max = 512, message = "The branch must be at least 1 character and at most 512 characters")
private String branch;
@@ -298,6 +298,7 @@ public class ProofControllerTest {
final Proof proof = new Proof();
proof.setTheoremName("Test proof");
proof.setTheorem(1);
proof.setBranch("Test branch");
proof.setProof("test proof");
proof.setDateCreated(new Date());