Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Jan 8, 2025
1 parent 4edc630 commit aea3523
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean isServerVersionGtOrEq7() {
/**
* @return true if Server version is 8.0 or greater
*/
public boolean isMRTSupported() {
public boolean isTxnSupported() {
return ModuleDescriptor.Version.parse(getServerVersion())
.compareTo(SERVER_VERSION_8_0_0_0) >= 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ReactiveAerospikeTemplateTransactionTests extends BaseReactiveInteg

@BeforeAll
public void beforeAll() {
TestUtils.checkAssumption(serverVersionSupport.isMRTSupported(),
TestUtils.checkAssumption(serverVersionSupport.isTxnSupported(),
"Skipping transactions tests because Aerospike Server 8.0.0+ is required", log);
}

Expand Down Expand Up @@ -164,7 +164,7 @@ public void verifyMultipleWritesInTransactionWithTimeoutExpired() {
.as(StepVerifier::create)
.verifyErrorMatches(throwable -> {
if (throwable instanceof RecoverableDataAccessException) {
return throwable.getMessage().contains("MRT expired");
return throwable.getMessage().contains("Transaction expired");
}
return false;
});
Expand All @@ -185,7 +185,7 @@ public void verifyMultipleWritesInTransactionWithDefaultTimeoutExpired() {
.as(StepVerifier::create)
.verifyErrorMatches(throwable -> {
if (throwable instanceof RecoverableDataAccessException) {
return throwable.getMessage().contains("MRT expired");
return throwable.getMessage().contains("Transaction expired");
}
return false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class ReactiveAerospikeTemplateTransactionUnitTests extends BaseReactiveI

@BeforeAll
public void beforeAll() {
TestUtils.checkAssumption(serverVersionSupport.isMRTSupported(),
TestUtils.checkAssumption(serverVersionSupport.isTxnSupported(),
"Skipping transactions tests because Aerospike Server 8.0.0+ is required", log);
when(mockTxManager.getReactiveTransaction(any()))
.thenReturn(Mono.just(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class AerospikeTemplateTransactionTests extends BaseBlockingIntegrationTe

@BeforeAll
public void beforeAll() {
TestUtils.checkAssumption(serverVersionSupport.isMRTSupported(),
TestUtils.checkAssumption(serverVersionSupport.isTxnSupported(),
"Skipping transactions tests because Aerospike Server 8.0.0+ is required", log);
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public void multipleWritesInTransactionWithTimeoutExpired() {
template.save(new SampleClasses.DocumentWithIntegerId(115, "test2"));
}))
.isInstanceOf(RecoverableDataAccessException.class)
.hasMessageContaining("MRT expired");
.hasMessageContaining("Transaction expired");

SampleClasses.DocumentWithIntegerId result = template.findById(115, SampleClasses.DocumentWithIntegerId.class);
assertThat(result).isNull(); // No record is written because all commands were in the same transaction
Expand All @@ -154,7 +154,7 @@ public void multipleWritesInTransactionWithDefaultTimeoutExpired() {
template.save(new SampleClasses.DocumentWithIntegerId(124, "test2"));
}))
.isInstanceOf(RecoverableDataAccessException.class)
.hasMessageContaining("MRT expired");
.hasMessageContaining("Transaction expired");

SampleClasses.DocumentWithIntegerId result = template.findById(124, SampleClasses.DocumentWithIntegerId.class);
assertThat(result).isNull(); // No record is written because all commands were in the same transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class AerospikeTemplateTransactionUnitTests extends BaseBlockingIntegrati

@BeforeAll
public void beforeAll() {
TestUtils.checkAssumption(serverVersionSupport.isMRTSupported(),
TestUtils.checkAssumption(serverVersionSupport.isTxnSupported(),
"Skipping transactions tests because Aerospike Server 8.0.0+ is required", log);
utils = new AerospikeTransactionTestUtils(client, template);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class AerospikeTransactionalAnnotationTests extends BaseBlockingIntegrati

@BeforeAll
public void beforeAll() {
TestUtils.checkAssumption(serverVersionSupport.isMRTSupported(),
TestUtils.checkAssumption(serverVersionSupport.isTxnSupported(),
"Skipping transactions tests because Aerospike Server 8.0.0+ is required", log);
}

Expand Down Expand Up @@ -180,7 +180,7 @@ public void verifyTransaction_multipleInserts_withTimeoutExpired() {
AwaitilityUtils.wait(3, SECONDS); // wait more than the given timeout
assertThatThrownBy(() -> template.insert(new SampleClasses.DocumentWithPrimitiveIntId(306)))
.isInstanceOf(RecoverableDataAccessException.class)
.hasMessageContaining("MRT expired");
.hasMessageContaining("Transaction expired");
}

@Test
Expand Down Expand Up @@ -234,7 +234,7 @@ public void verifyTransaction_multipleBatchInserts_withTimeoutExpired() {
template.insertAll(List.of(new SampleClasses.DocumentWithPrimitiveIntId(310),
new SampleClasses.DocumentWithPrimitiveIntId(410)));
} catch (AerospikeException.BatchRecordArray e) {
System.out.println("MRT expired");
System.out.println("Transaction expired");
}
}

Expand Down

0 comments on commit aea3523

Please sign in to comment.