All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.valfirst.jbehave.junit.monitoring.DescriptionTextUniquefier Maven / Gradle / Ivy

Go to download

Library designed to make JBehave stories & scenarios show up in the JUnit view in IDEs supportting custom test runners

There is a newer version: 2.3.2
Show newest version
package com.github.valfirst.jbehave.junit.monitoring;

import java.util.HashSet;
import java.util.Set;

public class DescriptionTextUniquefier {

	private Set uniqueDescriptions = new HashSet<>();

	public String getUniqueDescription(String junitSafeString) {
		String uniqueDescription = junitSafeString;
		while (uniqueDescriptions.contains(uniqueDescription)) {
			uniqueDescription += '\u200B'; // zero-width-space
		}
		uniqueDescriptions.add(uniqueDescription);
		return uniqueDescription;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy