From 826a00a56a80ebabab8143b880167cc18620e327 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 24 Dec 2015 12:38:26 +0100 Subject: [PATCH] Expect IllegalStateException instead of specific message for @Scheduled proxy mismatch Issue: SPR-13816 --- ...cheduledAndTransactionalAnnotationIntegrationTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java index 318fa211b76a..430952a207f9 100644 --- a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java +++ b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import org.junit.Before; import org.junit.Test; + import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -61,10 +62,10 @@ public void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() { ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigA.class); try { ctx.refresh(); - fail("expected exception"); + fail("Should have thrown BeanCreationException"); } catch (BeanCreationException ex) { - assertTrue(ex.getRootCause().getMessage().startsWith("@Scheduled method 'scheduled' found")); + assertTrue(ex.getRootCause() instanceof IllegalStateException); } }