Merge branch '2.1.x'
Closes gh-17079
This commit is contained in:
@@ -26,8 +26,7 @@ import org.springframework.context.ApplicationContext;
|
||||
public class SampleAtomikosApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ApplicationContext context = SpringApplication
|
||||
.run(SampleAtomikosApplication.class, args);
|
||||
ApplicationContext context = SpringApplication.run(SampleAtomikosApplication.class, args);
|
||||
AccountService service = context.getBean(AccountService.class);
|
||||
AccountRepository repository = context.getBean(AccountRepository.class);
|
||||
service.createAccountAndNotify("josh");
|
||||
|
||||
@@ -36,14 +36,12 @@ class SampleAtomikosApplicationTests {
|
||||
@Test
|
||||
void testTransactionRollback(CapturedOutput capturedOutput) throws Exception {
|
||||
SampleAtomikosApplication.main(new String[] {});
|
||||
assertThat(capturedOutput.toString()).has(substring(1, "---->"))
|
||||
.has(substring(1, "----> josh")).has(substring(2, "Count is 1"))
|
||||
.has(substring(1, "Simulated error"));
|
||||
assertThat(capturedOutput.toString()).has(substring(1, "---->")).has(substring(1, "----> josh"))
|
||||
.has(substring(2, "Count is 1")).has(substring(1, "Simulated error"));
|
||||
}
|
||||
|
||||
private Condition<String> substring(int times, String substring) {
|
||||
return new Condition<String>(
|
||||
"containing '" + substring + "' " + times + " times") {
|
||||
return new Condition<String>("containing '" + substring + "' " + times + " times") {
|
||||
|
||||
@Override
|
||||
public boolean matches(String value) {
|
||||
|
||||
Reference in New Issue
Block a user