Skip to content

Commit

Permalink
Merge pull request #3342 from hazendaz/formatting
Browse files Browse the repository at this point in the history
Formatting
  • Loading branch information
hazendaz authored Dec 28, 2024
2 parents 04f511f + 5abb46b commit 5d7e1eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ private Discriminator processDiscriminatorElement(XNode context, Class<?> result
Map<String, String> discriminatorMap = new HashMap<>();
for (XNode caseChild : context.getChildren()) {
String value = caseChild.getStringAttribute("value");
String resultMap = caseChild.getStringAttribute("resultMap", () -> processNestedResultMappings(caseChild, resultMappings, resultType));
String resultMap = caseChild.getStringAttribute("resultMap",
() -> processNestedResultMappings(caseChild, resultMappings, resultType));
discriminatorMap.put(value, resultMap);
}
return builderAssistant.buildDiscriminator(resultType, column, javaTypeClass, jdbcTypeEnum, typeHandlerClass,
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/org/apache/ibatis/type/TypeAliasRegistryTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2022 the original author or authors.
* Copyright 2009-2024 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.
Expand Down Expand Up @@ -80,17 +80,16 @@ void shouldFetchCharType() {
void shouldNotBeAbleToRegisterAliasWithEmptyString() {
TypeAliasRegistry typeAliasRegistry = new TypeAliasRegistry();

assertThatThrownBy(() -> typeAliasRegistry.registerAlias("foo", ""))
.isInstanceOf(TypeException.class)
.hasMessageContaining("Error registering type alias foo for");
assertThatThrownBy(() -> typeAliasRegistry.registerAlias("foo", "")).isInstanceOf(TypeException.class)
.hasMessageContaining("Error registering type alias foo for");
}

@Test
void shouldNotBeAbleToResolveNotExistsAlias() {
TypeAliasRegistry typeAliasRegistry = new TypeAliasRegistry();

assertThatThrownBy(() -> typeAliasRegistry.resolveAlias("abc"))
.isInstanceOf(TypeException.class)
.hasMessageContaining("Could not resolve type alias 'abc'. Cause: java.lang.ClassNotFoundException: Cannot find class: abc");
assertThatThrownBy(() -> typeAliasRegistry.resolveAlias("abc")).isInstanceOf(TypeException.class)
.hasMessageContaining(
"Could not resolve type alias 'abc'. Cause: java.lang.ClassNotFoundException: Cannot find class: abc");
}
}

0 comments on commit 5d7e1eb

Please sign in to comment.