Skip to content

Commit 826a00a

Browse files
committed
Expect IllegalStateException instead of specific message for @scheduled proxy mismatch
Issue: SPR-13816
1 parent d1551bd commit 826a00a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020

2121
import org.junit.Before;
2222
import org.junit.Test;
23+
2324
import org.springframework.aop.support.AopUtils;
2425
import org.springframework.beans.factory.BeanCreationException;
2526
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -61,10 +62,10 @@ public void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() {
6162
ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigA.class);
6263
try {
6364
ctx.refresh();
64-
fail("expected exception");
65+
fail("Should have thrown BeanCreationException");
6566
}
6667
catch (BeanCreationException ex) {
67-
assertTrue(ex.getRootCause().getMessage().startsWith("@Scheduled method 'scheduled' found"));
68+
assertTrue(ex.getRootCause() instanceof IllegalStateException);
6869
}
6970
}
7071

0 commit comments

Comments
 (0)