11package com .devskiller .friendly_id .openfeign ;
22
33import java .io .IOException ;
4- import java .lang .reflect .Type ;
54import java .util .UUID ;
65
76import org .junit .jupiter .api .Test ;
87
9- import feign .Response ;
8+ import com .devskiller .friendly_id .type .FriendlyId ;
9+
1010import feign .codec .Decoder ;
1111
12+ import static com .devskiller .friendly_id .FriendlyIds .toFriendlyId ;
1213import static org .assertj .core .api .Assertions .assertThat ;
1314
1415class FriendlyIdDecoderTest {
@@ -17,8 +18,8 @@ class FriendlyIdDecoderTest {
1718 void shouldDecodeFriendlyIdStringToUuid () throws IOException {
1819 // given
1920 UUID expectedUuid = UUID .fromString ("c3587ec5-0976-497f-8374-61e0c2ea3da5" );
20- String friendlyIdString = com . devskiller . friendly_id . FriendlyId . toFriendlyId (expectedUuid );
21-
21+ String friendlyIdString = toFriendlyId (expectedUuid );
22+
2223 Decoder delegateDecoder = (response , type ) -> friendlyIdString ;
2324 FriendlyIdDecoder decoder = new FriendlyIdDecoder (delegateDecoder );
2425
@@ -33,18 +34,18 @@ void shouldDecodeFriendlyIdStringToUuid() throws IOException {
3334 void shouldDecodeFriendlyIdStringToFriendlyIdValueObject () throws IOException {
3435 // given
3536 UUID uuid = UUID .fromString ("c3587ec5-0976-497f-8374-61e0c2ea3da5" );
36- String friendlyIdString = com . devskiller . friendly_id . FriendlyId . toFriendlyId (uuid );
37-
37+ String friendlyIdString = toFriendlyId (uuid );
38+
3839 Decoder delegateDecoder = (response , type ) -> friendlyIdString ;
3940 FriendlyIdDecoder decoder = new FriendlyIdDecoder (delegateDecoder );
4041
4142 // when
42- Object result = decoder .decode (null , com . devskiller . friendly_id . type . FriendlyId .class );
43+ Object result = decoder .decode (null , FriendlyId .class );
4344
4445 // then
4546 assertThat (result )
46- .isInstanceOf (com . devskiller . friendly_id . type . FriendlyId .class )
47- .extracting (fid -> ((com . devskiller . friendly_id . type . FriendlyId ) fid ).uuid ())
47+ .isInstanceOf (FriendlyId .class )
48+ .extracting (fid -> ((FriendlyId ) fid ).uuid ())
4849 .isEqualTo (uuid );
4950 }
5051
0 commit comments