diff options
author | Sergio Ozaki <sergio.ozaki@gmail.com> | 2017-07-30 15:37:37 -0300 |
---|---|---|
committer | pascalschumacher <pascalschumacher@gmx.net> | 2018-01-12 18:28:27 +0100 |
commit | f5ebb9a649e9dd0773f9bd3457d6ce1895266d59 (patch) | |
tree | da9750eaca23296f8fbd78d2fcf1b38808d916f6 /src/test/java/org/apache/commons | |
parent | 63f11e9dc1874abdde1bfe1d900b5ebfa4d3a941 (diff) | |
download | apache-commons-lang-f5ebb9a649e9dd0773f9bd3457d6ce1895266d59.tar.gz |
LANG-1372: Add ToStringSummary annotation (closes #281)
Diffstat (limited to 'src/test/java/org/apache/commons')
-rw-r--r-- | src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderSummaryTest.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderSummaryTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderSummaryTest.java new file mode 100644 index 000000000..d13fd0f9a --- /dev/null +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderSummaryTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.lang3.builder; + +import org.junit.Assert; +import org.junit.Test; + +public class ReflectionToStringBuilderSummaryTest { + + @SuppressWarnings("unused") + private String stringField = "string"; + + @ToStringSummary + private String summaryString = "summary"; + + @Test + public void testSummary() { + Assert.assertEquals("[stringField=string,summaryString=<String>]", + new ReflectionToStringBuilder(this, ToStringStyle.NO_CLASS_NAME_STYLE).build()); + } + +} |