use of org.junitpioneer.jupiter.DefaultLocale in project checkstyle by checkstyle.
the class DefaultLoggerTest method testCleatBundleCache.
@DefaultLocale("fr")
@Test
public void testCleatBundleCache() throws Exception {
final Constructor<?> cons = getConstructor();
cons.setAccessible(true);
final Object messageClass = cons.newInstance(DefaultLogger.ADD_EXCEPTION_MESSAGE, null);
final Method message = messageClass.getClass().getDeclaredMethod("getMessage");
message.setAccessible(true);
final Map<String, ResourceBundle> bundleCache = TestUtil.getInternalStaticState(message.getDeclaringClass(), "BUNDLE_CACHE");
assertWithMessage("Invalid message").that(message.invoke(messageClass)).isEqualTo("Une erreur est survenue {0}");
assertWithMessage("Invalid bundle cache size").that(bundleCache).hasSize(1);
}
use of org.junitpioneer.jupiter.DefaultLocale in project mapstruct by mapstruct.
the class Issue2544Test method shouldConvertEn.
// Parsing numbers is sensitive to locale settings (e.g. decimal point)
@ProcessorTest
@DefaultLocale("en")
public void shouldConvertEn() {
Issue2544Mapper.Target target = Issue2544Mapper.INSTANCE.map("123.45679E6");
assertThat(target).isNotNull();
assertThat(target.getBigNumber()).isEqualTo(new BigDecimal("1.2345679E+8"));
}
use of org.junitpioneer.jupiter.DefaultLocale in project mapstruct by mapstruct.
the class Issue2544Test method shouldConvertDe.
@ProcessorTest
@DefaultLocale("de")
public void shouldConvertDe() {
Issue2544Mapper.Target target = Issue2544Mapper.INSTANCE.map("123,45679E6");
assertThat(target).isNotNull();
assertThat(target.getBigNumber()).isEqualTo(new BigDecimal("1.2345679E+8"));
}
Aggregations