Polish "Use idiomatic AssertJ map assertions"
See gh-31752
This commit is contained in:
parent
6f11716b6f
commit
1da40b84e7
|
@ -39,6 +39,7 @@ import org.springframework.core.io.UrlResource;
|
|||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import static java.util.Map.entry;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
|
@ -384,8 +385,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("genericMap", inputMap);
|
||||
|
||||
assertThat(holder.getGenericMap().keySet().iterator().next().get(0)).isEqualTo(1);
|
||||
assertThat(holder.getGenericMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getGenericMap()).containsOnly(entry(List.of(1), List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -401,8 +401,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("genericMap", inputMap);
|
||||
|
||||
assertThat(holder.getGenericMap().keySet().iterator().next().get(0)).isEqualTo(1);
|
||||
assertThat(holder.getGenericMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getGenericMap()).containsOnly(entry(List.of(1), List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -414,8 +413,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("genericIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getGenericIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getGenericIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getGenericIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -427,8 +425,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("genericIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getGenericIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getGenericIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getGenericIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -439,8 +436,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("genericIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getGenericIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getGenericIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getGenericIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -452,8 +448,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("derivedIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getDerivedIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getDerivedIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getDerivedIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -465,8 +460,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("derivedIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getDerivedIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getDerivedIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getDerivedIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -477,8 +471,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("derivedIndexedMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getDerivedIndexedMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getDerivedIndexedMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getDerivedIndexedMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -490,8 +483,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("multiValueMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getMultiValueMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getMultiValueMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getMultiValueMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -503,8 +495,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("multiValueMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getMultiValueMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getMultiValueMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getMultiValueMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -515,8 +506,7 @@ class BeanWrapperGenericsTests {
|
|||
BeanWrapper bw = new BeanWrapperImpl(holder);
|
||||
bw.setPropertyValue("multiValueMap[1]", inputValue);
|
||||
|
||||
assertThat(holder.getMultiValueMap().keySet().iterator().next()).isEqualTo(1);
|
||||
assertThat(holder.getMultiValueMap().values().iterator().next().get(0)).isEqualTo(Long.valueOf(10));
|
||||
assertThat(holder.getMultiValueMap()).containsOnly(entry(1, List.of(10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -59,12 +59,10 @@ public class Spr8954Tests {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map<String, FactoryBean> fbBeans = bf.getBeansOfType(FactoryBean.class);
|
||||
assertThat(fbBeans).hasSize(1);
|
||||
assertThat(fbBeans.keySet()).contains("&foo");
|
||||
assertThat(fbBeans).containsOnlyKeys("&foo");
|
||||
|
||||
Map<String, AnInterface> aiBeans = bf.getBeansOfType(AnInterface.class);
|
||||
assertThat(aiBeans).hasSize(1);
|
||||
assertThat(aiBeans.keySet()).contains("&foo");
|
||||
assertThat(aiBeans).containsOnlyKeys("&foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -73,12 +71,10 @@ public class Spr8954Tests {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map<String, FactoryBean> fbBeans = bf.getBeansOfType(FactoryBean.class);
|
||||
assertThat(fbBeans.size()).isEqualTo(1);
|
||||
assertThat(fbBeans.keySet().iterator().next()).isEqualTo("&foo");
|
||||
assertThat(fbBeans).containsOnlyKeys("&foo");
|
||||
|
||||
Map<String, AnInterface> aiBeans = bf.getBeansOfType(AnInterface.class);
|
||||
assertThat(aiBeans).hasSize(1);
|
||||
assertThat(aiBeans.keySet()).contains("&foo");
|
||||
assertThat(aiBeans).containsOnlyKeys("&foo");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,8 +86,7 @@ public class Spr8954Tests {
|
|||
assertThat(Arrays.asList(names)).contains("&foo");
|
||||
|
||||
Map<String, AnInterface> beans = bf.getBeansOfType(AnInterface.class, false, false);
|
||||
assertThat(beans).hasSize(1);
|
||||
assertThat(beans.keySet()).contains("&foo");
|
||||
assertThat(beans).containsOnlyKeys("&foo");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -386,9 +386,9 @@ class JavaMailSenderTests {
|
|||
assertThat(sender.transport.isCloseCalled()).isTrue();
|
||||
assertThat(sender.transport.getSentMessages()).hasSize(1);
|
||||
assertThat(sender.transport.getSentMessage(0).getAllRecipients()[0]).isEqualTo(new InternetAddress("she@mail.org"));
|
||||
assertThat(ex.getFailedMessages().keySet()).containsExactly(simpleMessage1);
|
||||
Exception subEx = ex.getFailedMessages().values().iterator().next();
|
||||
assertThat(subEx).isInstanceOf(MessagingException.class).hasMessage("failed");
|
||||
assertThat(ex.getFailedMessages()).containsOnlyKeys(simpleMessage1);
|
||||
assertThat(ex.getFailedMessages().get(simpleMessage1))
|
||||
.isInstanceOf(MessagingException.class).hasMessage("failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,9 +413,9 @@ class JavaMailSenderTests {
|
|||
assertThat(sender.transport.getConnectedPassword()).isEqualTo("password");
|
||||
assertThat(sender.transport.isCloseCalled()).isTrue();
|
||||
assertThat(sender.transport.getSentMessages()).containsExactly(mimeMessage2);
|
||||
assertThat(ex.getFailedMessages().keySet()).containsExactly(mimeMessage1);
|
||||
Exception subEx = ex.getFailedMessages().values().iterator().next();
|
||||
assertThat(subEx).isInstanceOf(MessagingException.class).hasMessage("failed");
|
||||
assertThat(ex.getFailedMessages()).containsOnlyKeys(mimeMessage1);
|
||||
assertThat(ex.getFailedMessages().get(mimeMessage1))
|
||||
.isInstanceOf(MessagingException.class).hasMessage("failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -145,16 +145,14 @@ public class ConfigurationClassWithConditionTests {
|
|||
public void noConditionOnOverriddenMethodHonored() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConfigWithBeanReactivated.class);
|
||||
Map<String, ExampleBean> beans = context.getBeansOfType(ExampleBean.class);
|
||||
assertThat(beans).hasSize(1);
|
||||
assertThat(beans.keySet().iterator().next()).isEqualTo("baz");
|
||||
assertThat(beans).containsOnlyKeys("baz");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void configWithAlternativeBeans() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConfigWithAlternativeBeans.class);
|
||||
Map<String, ExampleBean> beans = context.getBeansOfType(ExampleBean.class);
|
||||
assertThat(beans).hasSize(1);
|
||||
assertThat(beans.keySet().iterator().next()).isEqualTo("baz");
|
||||
assertThat(beans).containsOnlyKeys("baz");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -24,7 +24,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -141,10 +140,8 @@ public class ImportSelectorTests {
|
|||
ordered.verify(beanFactory).registerBeanDefinition(eq("c"), any());
|
||||
ordered.verify(beanFactory).registerBeanDefinition(eq("d"), any());
|
||||
assertThat(TestImportGroup.instancesCount.get()).isEqualTo(1);
|
||||
assertThat(TestImportGroup.imports).hasSize(2);
|
||||
Iterator<AnnotationMetadata> iterator = TestImportGroup.imports.keySet().iterator();
|
||||
assertThat(iterator.next().getClassName()).isEqualTo(GroupedConfig2.class.getName());
|
||||
assertThat(iterator.next().getClassName()).isEqualTo(GroupedConfig1.class.getName());
|
||||
assertThat(TestImportGroup.imports.keySet().stream().map(AnnotationMetadata::getClassName))
|
||||
.containsExactly(GroupedConfig2.class.getName(),GroupedConfig1.class.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -57,12 +57,10 @@ public class Spr8954Tests {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map<String, FactoryBean> fbBeans = bf.getBeansOfType(FactoryBean.class);
|
||||
assertThat(fbBeans.size()).isEqualTo(1);
|
||||
assertThat(fbBeans.keySet().iterator().next()).isEqualTo("&foo");
|
||||
assertThat(fbBeans).containsOnlyKeys("&foo");
|
||||
|
||||
Map<String, AnInterface> aiBeans = bf.getBeansOfType(AnInterface.class);
|
||||
assertThat(aiBeans.size()).isEqualTo(1);
|
||||
assertThat(aiBeans.keySet().iterator().next()).isEqualTo("&foo");
|
||||
assertThat(aiBeans).containsOnlyKeys("&foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -76,12 +74,10 @@ public class Spr8954Tests {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map<String, FactoryBean> fbBeans = bf.getBeansOfType(FactoryBean.class);
|
||||
assertThat(fbBeans.size()).isEqualTo(1);
|
||||
assertThat(fbBeans.keySet().iterator().next()).isEqualTo("&foo");
|
||||
assertThat(fbBeans).containsOnlyKeys("&foo");
|
||||
|
||||
Map<String, AnInterface> aiBeans = bf.getBeansOfType(AnInterface.class);
|
||||
assertThat(aiBeans.size()).isEqualTo(1);
|
||||
assertThat(aiBeans.keySet().iterator().next()).isEqualTo("&foo");
|
||||
assertThat(aiBeans).containsOnlyKeys("&foo");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -189,8 +189,7 @@ class SelectionAndProjectionTests {
|
|||
|
||||
Expression exp = parser.parseExpression("colors.^[key.startsWith('b')]");
|
||||
Map<String, String> colorsMap = (Map<String, String>) exp.getValue(context);
|
||||
assertThat(colorsMap).hasSize(1);
|
||||
assertThat(colorsMap.keySet().iterator().next()).isEqualTo("beige");
|
||||
assertThat(colorsMap).containsOnlyKeys("beige");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -201,8 +200,7 @@ class SelectionAndProjectionTests {
|
|||
|
||||
Expression exp = parser.parseExpression("colors.$[key.startsWith('b')]");
|
||||
Map<String, String> colorsMap = (Map<String, String>) exp.getValue(context);
|
||||
assertThat(colorsMap).hasSize(1);
|
||||
assertThat(colorsMap.keySet().iterator().next()).isEqualTo("brown");
|
||||
assertThat(colorsMap).containsOnlyKeys("brown");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -19,7 +19,6 @@ package org.springframework.messaging;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
|
@ -153,9 +152,7 @@ public class MessageHeadersTests {
|
|||
map.put("key1", "val1");
|
||||
map.put("key2", 123);
|
||||
MessageHeaders headers = new MessageHeaders(map);
|
||||
Set<String> keys = headers.keySet();
|
||||
assertThat(keys.contains("key1")).isTrue();
|
||||
assertThat(keys.contains("key2")).isTrue();
|
||||
assertThat(headers).containsKeys("key1", "key2");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -66,7 +66,6 @@ public class MethodMessageHandlerTests {
|
|||
TestMethodMessageHandler messageHandler = initMethodMessageHandler(TestController.class);
|
||||
Map<String, HandlerMethod> mappings = messageHandler.getHandlerMethods();
|
||||
|
||||
assertThat(mappings.keySet()).hasSize(5);
|
||||
assertThat(mappings).containsOnlyKeys(
|
||||
"/handleMessage", "/handleMessageWithArgument", "/handleMessageWithError",
|
||||
"/handleMessageMatch1", "/handleMessageMatch2");
|
||||
|
|
|
@ -157,8 +157,7 @@ public class MessageHeaderAccessorTests {
|
|||
headers.copyHeaders(null);
|
||||
headers.copyHeadersIfAbsent(null);
|
||||
|
||||
assertThat(headers.getMessageHeaders()).hasSize(1);
|
||||
assertThat(headers.getMessageHeaders().keySet()).isEqualTo(Collections.singleton("id"));
|
||||
assertThat(headers.getMessageHeaders()).containsOnlyKeys(Collections.singleton("id"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.springframework.orm.jpa.persistenceunit;
|
|||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
@ -37,6 +36,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
|||
import org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup;
|
||||
import org.springframework.jdbc.datasource.lookup.MapDataSourceLookup;
|
||||
|
||||
import static java.util.Map.entry;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatRuntimeException;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class PersistenceXmlParsingTests {
|
|||
|
||||
assertThat(info[0].getMappingFileNames()).hasSize(1);
|
||||
assertThat(info[0].getMappingFileNames().get(0)).isEqualTo("mappings.xml");
|
||||
assertThat(info[0].getProperties().keySet()).isEmpty();
|
||||
assertThat(info[0].getProperties()).isEmpty();
|
||||
|
||||
assertThat(info[0].excludeUnlistedClasses()).as("Exclude unlisted should default false in 1.0.").isFalse();
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class PersistenceXmlParsingTests {
|
|||
assertThat(info[0].getJarFileUrls().get(0)).isEqualTo(new ClassPathResource("order.jar").getURL());
|
||||
assertThat(info[0].getJarFileUrls().get(1)).isEqualTo(new ClassPathResource("order-supplemental.jar").getURL());
|
||||
|
||||
assertThat(info[0].getProperties().keySet()).isEmpty();
|
||||
assertThat(info[0].getProperties()).isEmpty();
|
||||
assertThat(info[0].getJtaDataSource()).isNull();
|
||||
assertThat(info[0].getNonJtaDataSource()).isNull();
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class PersistenceXmlParsingTests {
|
|||
assertThat(info[0].excludeUnlistedClasses()).as("Exclude unlisted should be true when no value.").isTrue();
|
||||
|
||||
assertThat(info[0].getTransactionType()).isSameAs(PersistenceUnitTransactionType.RESOURCE_LOCAL);
|
||||
assertThat(info[0].getProperties().keySet()).isEmpty();
|
||||
assertThat(info[0].getProperties()).isEmpty();
|
||||
|
||||
builder.clear();
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public class PersistenceXmlParsingTests {
|
|||
assertThat(info[0].getJarFileUrls().get(1)).isEqualTo(new ClassPathResource("order-supplemental.jar").getURL());
|
||||
|
||||
assertThat(info[0].getPersistenceProviderClassName()).isEqualTo("com.acme.AcmePersistence");
|
||||
assertThat(info[0].getProperties().keySet()).isEmpty();
|
||||
assertThat(info[0].getProperties()).isEmpty();
|
||||
|
||||
assertThat(info[0].excludeUnlistedClasses()).as("Exclude unlisted should default false in 1.0.").isFalse();
|
||||
}
|
||||
|
@ -210,10 +210,8 @@ public class PersistenceXmlParsingTests {
|
|||
|
||||
assertThat(pu1.getTransactionType()).isSameAs(PersistenceUnitTransactionType.RESOURCE_LOCAL);
|
||||
|
||||
Properties props = pu1.getProperties();
|
||||
assertThat(props.keySet()).hasSize(2);
|
||||
assertThat(props.getProperty("com.acme.persistence.sql-logging")).isEqualTo("on");
|
||||
assertThat(props.getProperty("foo")).isEqualTo("bar");
|
||||
assertThat(pu1.getProperties()).containsOnly(
|
||||
entry("com.acme.persistence.sql-logging", "on"), entry("foo", "bar"));
|
||||
|
||||
assertThat(pu1.getNonJtaDataSource()).isNull();
|
||||
|
||||
|
@ -249,7 +247,7 @@ public class PersistenceXmlParsingTests {
|
|||
PersistenceUnitInfo[] info = reader.readPersistenceUnitInfos(resource);
|
||||
assertThat(info).hasSize(1);
|
||||
assertThat(info[0].getPersistenceUnitName()).isEqualTo("pu");
|
||||
assertThat(info[0].getProperties().keySet()).isEmpty();
|
||||
assertThat(info[0].getProperties()).isEmpty();
|
||||
|
||||
assertThat(info[0].excludeUnlistedClasses()).as("Exclude unlisted should default false in 1.0.").isFalse();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue