diff --git a/CHANGELOG.md b/CHANGELOG.md index f64b6d9411..a831e675f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,15 @@ # v0.12.0 +## New Features + * Allow multiple formatter annotations on arguments, e.g., "@Quoted @YesNo", see [#204](https://github.com/TNG/JGiven/issues/204). * Added a new comment() method to provide further information on specific step method invocations, see [#50](https://github.com/TNG/JGiven/issues/50). +* Steps can now have multiple attachments [#194](https://github.com/TNG/JGiven/issues/194). +* Tags can now be hidden from the navigation bar in the HTML report by setting the `showInNavigation` attribute to `false` [#211](https://github.com/TNG/JGiven/issues/211). + +## Breaking Changes in the JSON model + +* Due to the introduction of multiple attachments per step, the JSON model had to be changed in an backwards-incompatible way. Instead of a single field `attachment` that holds a single attachment object, a step has now an `attachments` field that holds an array of attachment objects. # v0.11.4 diff --git a/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/IsTag.java b/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/IsTag.java index df3f478cd7..a131fd639a 100644 --- a/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/IsTag.java +++ b/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/IsTag.java @@ -1,13 +1,13 @@ package com.tngtech.jgiven.annotation; +import com.tngtech.jgiven.impl.tag.DefaultTagDescriptionGenerator; +import com.tngtech.jgiven.impl.tag.DefaultTagHrefGenerator; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.tngtech.jgiven.impl.tag.DefaultTagDescriptionGenerator; -import com.tngtech.jgiven.impl.tag.DefaultTagHrefGenerator; - /** * Marks an annotation to be used as a tag in JGiven reports. * The name and a possible value will be stored. @@ -68,7 +68,7 @@ *
* If this attribute is set, the {@link #description()} attribute is ignored. *
- * + * * @since 0.7.0 */ Class extends TagDescriptionGenerator> descriptionGenerator() default DefaultTagDescriptionGenerator.class; @@ -102,7 +102,7 @@ ** Non-HTML reports ignore this attribute *
- * + * * @since 0.7.2 */ String cssClass() default ""; @@ -120,7 +120,7 @@ * This attribute is for simple use cases. * For advanced styling options use the {@link #cssClass()} or {@link #style()} attributes instead. * - * + * * @since 0.7.2 */ String color() default ""; @@ -135,14 +135,14 @@ ** Non-HTML reports ignore this attribute *
- * + * * @since 0.8.0 */ String style() default ""; /** * An optional href of the tag that will appear in the generated report. - * + * * @since 0.9.5 */ String href() default ""; @@ -162,4 +162,11 @@ */ Class extends TagHrefGenerator> hrefGenerator() default DefaultTagHrefGenerator.class; + /** + * Whether the tag should be shown in the navigation part of the report + * + * @since 0.12.0 + */ + boolean showInNavigation() default true; + } diff --git a/jgiven-core/src/main/java/com/tngtech/jgiven/config/TagConfiguration.java b/jgiven-core/src/main/java/com/tngtech/jgiven/config/TagConfiguration.java index 1dd3f53e57..fb021112f2 100644 --- a/jgiven-core/src/main/java/com/tngtech/jgiven/config/TagConfiguration.java +++ b/jgiven-core/src/main/java/com/tngtech/jgiven/config/TagConfiguration.java @@ -1,17 +1,17 @@ package com.tngtech.jgiven.config; -import java.lang.annotation.Annotation; -import java.util.List; - import com.google.common.collect.Lists; +import com.tngtech.jgiven.annotation.TagDescriptionGenerator; import com.tngtech.jgiven.annotation.TagHrefGenerator; import com.tngtech.jgiven.impl.tag.DefaultTagDescriptionGenerator; -import com.tngtech.jgiven.annotation.TagDescriptionGenerator; import com.tngtech.jgiven.impl.tag.DefaultTagHrefGenerator; +import java.lang.annotation.Annotation; +import java.util.List; + /** * Represents the configuration of a tag. - * + * * @see com.tngtech.jgiven.annotation.IsTag for a documentation of the different values. */ public class TagConfiguration { @@ -29,6 +29,7 @@ public class TagConfiguration { private List- * Is either {@code true} or {@code null} + * Is either {@code true} or {@code null} */ private Boolean prependType; @@ -68,6 +68,14 @@ public class Tag { */ private String href; + /** + * Whether the tag should appear in the navigation part of the report + *
+ * Is either {@code true} or {@code null}
+ */
+ private Boolean hideInNav;
+ private boolean shownInNavigation;
+
public Tag( String type ) {
this.type = type;
}
@@ -134,7 +142,7 @@ public String getHref() {
return href;
}
- public void setHref(String href) {
+ public void setHref( String href ) {
this.href = href;
}
@@ -162,6 +170,10 @@ public Tag setPrependType( boolean prependType ) {
return this;
}
+ public void setShowInNavigation( boolean show ) {
+ this.hideInNav = show ? null : true;
+ }
+
@Override
public String toString() {
if( value != null ) {
@@ -213,7 +225,7 @@ public boolean equals( Object obj ) {
/**
* Returns a string representation where all non-alphanumeric characters are replaced with an underline (_).
* In addition, the result is cut-off at a length of 255 characters.
- *
+ *
* @return a string representation without special characters
*/
public String toEscapedString() {
@@ -235,6 +247,10 @@ public String getType() {
return type;
}
+ public boolean getShownInNavigation() {
+ return shownInNavigation;
+ }
+
public List