From 8a2b23d669b768f314821fa222ffdba25e6d5bdc Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Mon, 21 Nov 2016 15:20:49 -0600 Subject: [PATCH] Fixed unit tests due to changes in exception messages --- .../JpaPagingItemReaderIntegrationTests.java | 4 ++-- .../xml/JobLaunchingGatewayParserTests.java | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderIntegrationTests.java index 0e8b056b5..371ad371a 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderIntegrationTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderIntegrationTests.java @@ -43,9 +43,9 @@ public class JpaPagingItemReaderIntegrationTests extends AbstractGenericDataSour String jpqlQuery = "select f from Foo f where name like :name"; - JpaPagingItemReader inputSource = new JpaPagingItemReader(); + JpaPagingItemReader inputSource = new JpaPagingItemReader<>(); inputSource.setQueryString(jpqlQuery); - inputSource.setParameterValues(Collections.singletonMap("name", (Object)"bar%")); + inputSource.setParameterValues(Collections.singletonMap("name", "bar%")); inputSource.setEntityManagerFactory(entityManagerFactory); inputSource.setPageSize(3); inputSource.afterPropertiesSet(); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/config/xml/JobLaunchingGatewayParserTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/config/xml/JobLaunchingGatewayParserTests.java index a74e7c5b1..ca19739c6 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/config/xml/JobLaunchingGatewayParserTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/config/xml/JobLaunchingGatewayParserTests.java @@ -12,14 +12,9 @@ */ package org.springframework.batch.integration.config.xml; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - import org.junit.After; import org.junit.Test; + import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.integration.launch.JobLaunchingMessageHandler; import org.springframework.beans.factory.BeanCreationException; @@ -30,6 +25,12 @@ import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.test.util.TestUtils; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * * @author Gunnar Hillert @@ -77,7 +78,7 @@ public class JobLaunchingGatewayParserTests { setUp("JobLaunchingGatewayParserTestsNoJobLauncher-context.xml", getClass()); } catch(BeanCreationException e) { - assertEquals("No bean named 'jobLauncher' is defined", e.getCause().getMessage()); + assertEquals("No bean named 'jobLauncher' available", e.getCause().getMessage()); return; } fail("Expected a NoSuchBeanDefinitionException to be thrown.");