Polish [Simple]AliasRegistry[Tests]

This commit is contained in:
Sam Brannen 2020-01-06 11:30:05 +01:00
parent d0c2812dad
commit 3299793c8a
3 changed files with 13 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2020 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.
@ -17,7 +17,7 @@
package org.springframework.core;
/**
* Common interface for managing aliases. Serves as super-interface for
* Common interface for managing aliases. Serves as a super-interface for
* {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}.
*
* @author Juergen Hoeller
@ -42,7 +42,7 @@ public interface AliasRegistry {
void removeAlias(String alias);
/**
* Determine whether this given name is defines as an alias
* Determine whether the given name is defined as an alias
* (as opposed to the name of an actually registered component).
* @param name the name to check
* @return whether the given name is an alias

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 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.
@ -32,7 +32,7 @@ import org.springframework.util.StringValueResolver;
/**
* Simple implementation of the {@link AliasRegistry} interface.
* Serves as base class for
* <p>Serves as base class for
* {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}
* implementations.
*
@ -86,8 +86,8 @@ public class SimpleAliasRegistry implements AliasRegistry {
}
/**
* Return whether alias overriding is allowed.
* Default is {@code true}.
* Determine whether alias overriding is allowed.
* <p>Default is {@code true}.
*/
protected boolean allowAliasOverriding() {
return true;
@ -145,7 +145,7 @@ public class SimpleAliasRegistry implements AliasRegistry {
/**
* Resolve all alias target names and aliases registered in this
* factory, applying the given StringValueResolver to them.
* registry, applying the given {@link StringValueResolver} to them.
* <p>The value resolver may for example resolve placeholders
* in target bean names and even in alias names.
* @param valueResolver the StringValueResolver to apply

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 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.
@ -35,13 +35,13 @@ class SimpleAliasRegistryTests {
assertThat(registry.hasAlias("test", "testAlias")).isTrue();
assertThat(registry.hasAlias("test", "testAlias2")).isTrue();
assertThat(registry.hasAlias("test", "testAlias3")).isTrue();
assertThat(registry.canonicalName("testAlias")).isSameAs("test");
assertThat(registry.canonicalName("testAlias2")).isSameAs("test");
assertThat(registry.canonicalName("testAlias3")).isSameAs("test");
assertThat(registry.canonicalName("testAlias")).isEqualTo("test");
assertThat(registry.canonicalName("testAlias2")).isEqualTo("test");
assertThat(registry.canonicalName("testAlias3")).isEqualTo("test");
}
@Test // SPR-17191
void testAliasChainingWithMultipleAliases() {
void aliasChainingWithMultipleAliases() {
SimpleAliasRegistry registry = new SimpleAliasRegistry();
registry.registerAlias("name", "alias_a");
registry.registerAlias("name", "alias_b");