OutputStreamFormater { public static String formatValues(String name, String value) { return Ansi.ansi().a(" ").a(Ansi.Attribute.INTENSITY_BOLD).a(name) .a(spaces(padding - name.length())).a(Ansi.Attribute.RESET).a(" ").a(value).toString(); } private  OutputStreamFormater(); static void printValue(String name, String value); static void printValuesWithPrefix(String pref, String name, String value); static void printTabbedValues(int spaces, String name, String value); static String formatValues(String name, String value); static String formatValues(String pref, String name, String value); static String spaces(int nb); static void printValue(String value); static String formatValues(int spaces, String id, String status); static void setOutputStream(PrintStream outputStream); static void setPadding(int padding);  }
@Test public void testFormatValues_shouldFormatString() throws Exception { String string = " \u001B[1mOpenEngSB Version \u001B[m 3.0.0-SNAPSHOT"; assertThat(OutputStreamFormater.formatValues("OpenEngSB Version", "3.0.0-SNAPSHOT"), equalTo(string)); }
@Test public void testPrintWithPrefix_shouldPrintStringWithPrefix() throws Exception { String s = OutputStreamFormater.formatValues(9, "id", "status"); assertThat(s, equalTo(" \u001B[1mid \u001B[m status")); }