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

com.github.TurquoiseSpace.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

The newest version!
package com.github.TurquoiseSpace.jbehave.junit.monitoring;

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

public class DescriptionTextUniquefier {

	private final 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 - 2025 Weber Informatics LLC | Privacy Policy