|
24 | 24 | import java.time.Duration; |
25 | 25 | import java.time.temporal.ChronoUnit; |
26 | 26 |
|
| 27 | +import org.assertj.core.api.InstanceOfAssertFactories; |
27 | 28 | import org.junit.jupiter.api.Nested; |
28 | 29 | import org.junit.jupiter.api.Test; |
29 | 30 |
|
@@ -125,18 +126,14 @@ void convertXAddOptionsWithDeletionPolicy() { |
125 | 126 | @Test |
126 | 127 | void convertXAddOptionsWithRecordId() { |
127 | 128 |
|
128 | | - RecordId recordId = RecordId.of("1234567890-0"); |
| 129 | + String testId = "1234567890-0"; |
| 130 | + RecordId recordId = RecordId.of(testId); |
129 | 131 | XAddOptions options = XAddOptions.none(); |
130 | 132 |
|
131 | 133 | XAddParams params = StreamConverters.toXAddParams(recordId, options); |
132 | 134 |
|
133 | | - assertThat(params).hasFieldOrPropertyWithValue("maxLen", null); |
134 | | - assertThat(params).hasFieldOrPropertyWithValue("minId", null); |
135 | | - assertThat(params).hasFieldOrPropertyWithValue("limit", null); |
136 | | - assertThat(params).hasFieldOrPropertyWithValue("trimMode", null); |
137 | | - assertThat(params).hasFieldOrPropertyWithValue("nomkstream", false); |
138 | | - assertThat(params).hasFieldOrPropertyWithValue("exactTrimming", false); |
139 | | - assertThat(params).hasFieldOrPropertyWithValue("approximateTrimming", false); |
| 135 | + assertThat(params).extracting("id.raw").asInstanceOf(InstanceOfAssertFactories.BYTE_ARRAY) |
| 136 | + .satisfies(idRawBytes -> assertThat(new String(idRawBytes)).isEqualTo(testId)); |
140 | 137 | } |
141 | 138 | } |
142 | 139 |
|
|
0 commit comments