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

com.teamscale.wia.WiaTestUtils Maven / Gradle / Ivy

Go to download

The Teamscale Work Item Analysis provides the basis to analyze Work Items/Tickets/Requirements/Issues.

There is a newer version: 2024.9.0-rc3
Show newest version
package com.teamscale.wia;

import java.io.IOException;

import org.conqat.engine.commons.util.JsonUtils;
import org.conqat.lib.commons.io.SerializationUtils;

import com.fasterxml.jackson.dataformat.toml.TomlMapper;

/**
 * Helpers for work item analysis testing.
 */
public class WiaTestUtils {

	/** TOML mapper for (de-)serialization. */
	private static final TomlMapper MAPPER = JsonUtils.configureDefaultSettings(TomlMapper.builder()).build();

	/**
	 * Convert a work item from its TOML representation to its serialized binary object representation.
	 */
	public static byte[] tomlWorkItemToBinary(String toml) throws IOException {
		TeamscaleIssue workItem = MAPPER.readValue(toml, TeamscaleIssue.class);
		return SerializationUtils.serializeToByteArray(workItem);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy