File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
imagetool/src/test/java/com/oracle/weblogic/imagetool/logging Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
package com .oracle .weblogic .imagetool .logging ;
5
5
6
+ import java .util .logging .Level ;
7
+ import java .util .logging .LogRecord ;
8
+
6
9
import org .junit .jupiter .api .Test ;
7
10
8
- import static org .junit .jupiter .api .Assertions .assertEquals ;
11
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
9
12
10
13
11
14
class FileFormatterTest {
12
15
13
16
@ Test
14
17
void format () {
15
- assertEquals (true , true );
18
+ FileFormatter formatter = new FileFormatter ();
19
+ LogRecord logRecord = new LogRecord (Level .INFO , "message goes here" );
20
+
21
+ String logMessage = formatter .format (logRecord );
22
+ assertTrue (logMessage .startsWith ("####" ));
23
+ assertTrue (logMessage .endsWith ("<message goes here>\n " ));
24
+ }
25
+
26
+ @ Test
27
+ void formatWithColor () {
28
+ FileFormatter formatter = new FileFormatter ();
29
+ String initialValue = "message [[brightred: goes]] here" ;
30
+ LogRecord logRecord = new LogRecord (Level .INFO , initialValue );
31
+
32
+ String logMessage = formatter .format (logRecord );
33
+ // color should be removed for non-console logging
34
+ assertTrue (logMessage .endsWith ("<message goes here>\n " ));
16
35
}
17
36
}
You can’t perform that action at this time.
0 commit comments