|
43 | 43 | import org.junit.jupiter.api.Disabled;
|
44 | 44 | import org.junit.jupiter.api.Test;
|
45 | 45 | import org.junit.jupiter.api.condition.DisabledOnOs;
|
| 46 | +import org.junit.jupiter.params.ParameterizedTest; |
| 47 | +import org.junit.jupiter.params.provider.ValueSource; |
46 | 48 | import org.springframework.beans.factory.annotation.Autowired;
|
47 | 49 | import org.springframework.dao.DataAccessException;
|
48 | 50 | import org.springframework.data.domain.Range;
|
|
108 | 110 | * @author Andrey Shlykov
|
109 | 111 | * @author Hendrik Duerkop
|
110 | 112 | * @author Shyngys Sapraliyev
|
| 113 | + * @author Roman Osadchuk |
111 | 114 | */
|
112 | 115 | public abstract class AbstractConnectionIntegrationTests {
|
113 | 116 |
|
@@ -3574,6 +3577,23 @@ void bitFieldIncrByWithOverflowShouldWorkCorrectly() {
|
3574 | 3577 | assertThat(results.get(3)).isNotNull();
|
3575 | 3578 | }
|
3576 | 3579 |
|
| 3580 | + @ParameterizedTest // DATAREDIS-2903 |
| 3581 | + @ValueSource(booleans = {false, true}) |
| 3582 | + void bitFieldIncrByAndThenGetShouldWorkCorrectly(boolean isMultipliedByTypeLengthOffset) { |
| 3583 | + var offset = isMultipliedByTypeLengthOffset |
| 3584 | + ? BitFieldSubCommands.Offset.offset(300L).multipliedByTypeLength() |
| 3585 | + : BitFieldSubCommands.Offset.offset(400L); |
| 3586 | + |
| 3587 | + actual.add(connection.bitfield(KEY_1, create().incr(INT_8).valueAt(offset).by(1L))); |
| 3588 | + actual.add(connection.bitfield(KEY_1, create().get(INT_8).valueAt(offset))); |
| 3589 | + |
| 3590 | + List<Object> results = getResults(); |
| 3591 | + |
| 3592 | + assertThat(results).hasSize(2) |
| 3593 | + // should return same results after INCRBY and GET operations for bitfield with same offset |
| 3594 | + .containsExactly(List.of(1L), List.of(1L)); |
| 3595 | + } |
| 3596 | + |
3577 | 3597 | @Test // DATAREDIS-562
|
3578 | 3598 | void bitfieldShouldAllowMultipleSubcommands() {
|
3579 | 3599 |
|
|
0 commit comments