From 8155ded46193cd68de4ecaed77dc32335bb8f865 Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Thu, 28 Feb 2013 09:12:14 -0600 Subject: [PATCH] Fixing integration test due to change in Proxy's toString --- .../batch/core/scope/StepScopeIntegrationTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopeIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopeIntegrationTests.java index 099d668eb..30468194a 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopeIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopeIntegrationTests.java @@ -23,6 +23,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) public class StepScopeIntegrationTests { + private static final String PROXY_TO_STRING_REGEX = "class .*\\$Proxy\\d+"; + @Autowired @Qualifier("vanilla") private Step vanilla; @@ -65,7 +67,7 @@ public class StepScopeIntegrationTests { assertNotNull(collaborator); assertEquals("bar", collaborator); assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("collaborator.class")) - .startsWith("class $Proxy")); + .matches(PROXY_TO_STRING_REGEX)); } @Test @@ -79,7 +81,7 @@ public class StepScopeIntegrationTests { assertNotNull(parent); assertEquals("bar", parent); assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("parent.class")) - .startsWith("class $Proxy")); + .matches(PROXY_TO_STRING_REGEX)); } @Test