File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
bm-controller/src/test/java/org/benchmarker/bmcontroller/template/common Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .benchmarker .bmcontroller .template .common ;
2
+
3
+ import org .junit .jupiter .api .DisplayName ;
4
+ import org .junit .jupiter .api .Test ;
5
+ import org .springframework .boot .test .context .SpringBootTest ;
6
+
7
+ import java .time .LocalDate ;
8
+ import java .time .LocalDateTime ;
9
+ import java .time .LocalTime ;
10
+
11
+ import static org .assertj .core .api .Assertions .assertThat ;
12
+ import static org .junit .jupiter .api .Assertions .*;
13
+
14
+ @ SpringBootTest
15
+ class TemplateUtilsTest {
16
+
17
+ @ Test
18
+ @ DisplayName ("agent 에서 받은 시간 정확하게 Convert 하는지 확인" )
19
+ void convertStringToLocalDateTime () {
20
+
21
+ // given
22
+ String dateTimeString = "2024-03-30T15:25:27.410335250" ;
23
+
24
+ // when
25
+ LocalDateTime localDateTime = TemplateUtils .convertStringToLocalDateTime (dateTimeString );
26
+
27
+ // then
28
+ assertThat (localDateTime ).isEqualTo (LocalDateTime .of (LocalDate .parse ("2024-03-30" ), LocalTime .parse ("15:25:27" )));
29
+ }
30
+
31
+ }
You can’t perform that action at this time.
0 commit comments