-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for POST endpoint, fix for DataRecordAttribute
- Metamodel properties cannot be used here when entity-manager not present - Added explicit dependency on spring-boot validation (error when missing) - Docu update
- Loading branch information
Showing
8 changed files
with
100 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 17 additions & 10 deletions
27
...g-testapp/src/main/java/io/vigier/cursorpaging/testapp/api/model/DataRecordAttribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
package io.vigier.cursorpaging.testapp.api.model; | ||
|
||
import io.vigier.cursorpaging.jpa.Attribute; | ||
import io.vigier.cursorpaging.testapp.model.AuditInfo; | ||
import io.vigier.cursorpaging.testapp.model.AuditInfo_; | ||
import io.vigier.cursorpaging.testapp.model.DataRecord_; | ||
import java.time.Instant; | ||
import java.util.UUID; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum DataRecordAttribute { | ||
ID( Attribute.of( DataRecord_.id ) ), | ||
NAME( Attribute.of( DataRecord_.name ) ), | ||
CREATED_AT( Attribute.path( DataRecord_.auditInfo, AuditInfo_.createdAt ) ), | ||
MODIFIED_AT( Attribute.path( DataRecord_.auditInfo, AuditInfo_.modifiedAt ) ); | ||
private final Attribute attribute; | ||
// Not using the "lowercase" properties here, because there are tests where no EntityManager is instantiated | ||
// (i.e. the MockMVC test), but this one is needed to populate them :-( | ||
|
||
DataRecordAttribute( final Attribute attribute ) { | ||
this.attribute = attribute; | ||
} | ||
ID( Attribute.of( DataRecord_.NAME, UUID.class ) ), | ||
NAME( Attribute.of( DataRecord_.NAME, String.class ) ), | ||
CREATED_AT( Attribute.path( DataRecord_.AUDIT_INFO, AuditInfo.class, AuditInfo_.CREATED_AT, Instant.class ) ), | ||
MODIFIED_AT( Attribute.path( DataRecord_.AUDIT_INFO, AuditInfo.class, AuditInfo_.MODIFIED_AT, Instant.class ) ); | ||
|
||
private final Attribute attribute; | ||
|
||
public Attribute getAttribute() { | ||
return attribute; | ||
public static Attribute forName( final String name ) { | ||
return valueOf( name.toUpperCase() ).getAttribute(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters