DATACMNS-703 - PropertyReferenceException now exposes potential matches.

We now use Spring's PropertyMatches to build up the exception message and include a list of potentially meant properties.

Removed unused config file for tests along the way.

Original pull request: #125.
This commit is contained in:
Oliver Gierke
2015-05-21 19:57:28 +02:00
parent 2cb2830d59
commit d859540f92
3 changed files with 56 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2014 the original author or authors.
* Copyright 2011-2015 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.
@@ -353,6 +353,9 @@ public class PropertyPathUnitTests {
from("foo", (TypeInformation<?>) null);
}
/**
* @see DATACMNS-546
*/
@Test
public void returnsCompletePathIfResolutionFailedCompletely() {
@@ -362,8 +365,11 @@ public class PropertyPathUnitTests {
from("somethingDifferent", Foo.class);
}
/**
* @see DATACMNS-546
*/
@Test
public void foobar() {
public void includesResolvedPathInExceptionMessage() {
exception.expect(PropertyReferenceException.class);
exception.expectMessage("fooName");
@@ -373,6 +379,18 @@ public class PropertyPathUnitTests {
from("userFooName", Bar.class);
}
/**
* @see DATACMNS-703
*/
@Test
public void includesPropertyHintsOnTypos() {
exception.expect(PropertyReferenceException.class);
exception.expectMessage("userName");
from("userAme", Foo.class);
}
private class Foo {
String userName;