File tree Expand file tree Collapse file tree 2 files changed +11
-16
lines changed
main/java/uk/gov/hmcts/cp/subscription/clients/model
test/java/uk/gov/hmcts/cp/subscription/clients Expand file tree Collapse file tree 2 files changed +11
-16
lines changed Original file line number Diff line number Diff line change 11package uk .gov .hmcts .cp .subscription .clients .model ;
22
33import com .fasterxml .jackson .annotation .JsonFormat ;
4- import com .fasterxml .jackson .annotation .JsonProperty ;
54import jakarta .validation .constraints .NotNull ;
65import lombok .AllArgsConstructor ;
76import lombok .Getter ;
87import lombok .NoArgsConstructor ;
98
10- import java .time .OffsetDateTime ;
9+ import java .time .LocalDateTime ;
1110import java .util .UUID ;
1211
1312@ Getter
1615public class MaterialResponse {
1716
1817 @ NotNull
19- @ JsonProperty ("materialId" )
2018 private UUID materialId ;
2119
22- @ JsonProperty ("alfrescoAssetId" )
2320 private UUID alfrescoAssetId ;
2421
25- @ JsonProperty ("fileName" )
2622 private String fileName ;
2723
28- @ JsonProperty ("mimeType" )
2924 private String mimeType ;
3025
31- @ JsonProperty ("materialAddedDate" )
3226 @ JsonFormat (shape = JsonFormat .Shape .STRING )
33- private OffsetDateTime materialAddedDate ;
27+ private LocalDateTime materialAddedDate ;
3428}
3529
Original file line number Diff line number Diff line change @@ -22,21 +22,22 @@ class MaterialServiceIntegrationTest {
2222 @ Test
2323 void should_return_material_by_id () {
2424
25- UUID materialId = UUID .fromString ("6c198796-08bb-4803-b456-fa0c29ca6021" );
25+ final UUID materialId = UUID .fromString ("6c198796-08bb-4803-b456-fa0c29ca6021" );
2626 MaterialResponse response = materialService .getByMaterialId (materialId );
2727
28- assertThat (response ).isNotNull ();
29- assertThat (response .getMaterialId ()).isEqualTo (materialId );
30- assertThat (response .getAlfrescoAssetId ()).isEqualTo (UUID .fromString ("82257b1b-571d-432e-8871-b0c5b4bd18b1" ));
31- assertThat (response .getMimeType ()).isEqualTo ("application/pdf" );
32- assertThat (response .getFileName ()).isEqualTo ("PrisonCourtRegister_20251219083322.pdf" );
33- assertThat ( response . getMaterialAddedDate ()). isEqualTo ( "2025-12-19T08:33:29.866Z" );
28+ assertThat (response ).satisfies ( resp -> {
29+ assertThat (resp .getMaterialId ()).isEqualTo (materialId );
30+ assertThat (resp .getAlfrescoAssetId ()).isEqualTo (UUID .fromString ("82257b1b-571d-432e-8871-b0c5b4bd18b1" ));
31+ assertThat (resp .getMimeType ()).isEqualTo ("application/pdf" );
32+ assertThat (resp .getFileName ()).isEqualTo ("PrisonCourtRegister_20251219083322.pdf" );
33+ } );
3434 }
3535
3636 @ Test
3737 void should_throw_not_found_when_material_does_not_exist () {
3838 UUID materialId = UUID .fromString ("6c198796-08bb-4803-b456-fa0c29ca6022" );
3939 assertThatThrownBy (() -> materialService .getByMaterialId (materialId ))
40- .isInstanceOf (feign .FeignException .NotFound .class );
40+ .isInstanceOf (feign .FeignException .NotFound .class )
41+ .hasMessageContaining ("404" );
4142 }
4243}
You can’t perform that action at this time.
0 commit comments