Skip to content

Commit c08502b

Browse files
committed
add junit test
1 parent ff089bc commit c08502b

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

springboot-starter/src/test/java/com/codingapi/springboot/framework/FrameworkApplicationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class FrameworkApplicationTests {
99

1010
@Test
1111
void contextLoads() {
12+
1213
}
1314

1415
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.codingapi.springboot.framework.crypto;
2+
3+
import org.junit.jupiter.api.Test;
4+
import org.springframework.boot.test.context.SpringBootTest;
5+
6+
import java.io.IOException;
7+
import java.nio.charset.StandardCharsets;
8+
9+
import static org.junit.jupiter.api.Assertions.*;
10+
11+
@SpringBootTest
12+
class AESUtilsTest {
13+
14+
@Test
15+
void encodeDecodeToBase64() throws IOException {
16+
String word = "123";
17+
String encode = AESUtils.getInstance().encodeToBase64(word);
18+
String decode = AESUtils.getInstance().decodeToBase64(encode);
19+
assertEquals(word,decode,"AES encode error");
20+
}
21+
22+
23+
@Test
24+
void encodeDecode() throws IOException {
25+
byte[] word = "123".getBytes(StandardCharsets.UTF_8);
26+
byte[] encode = AESUtils.getInstance().encode(word);
27+
byte[] decode = AESUtils.getInstance().decode(encode);
28+
assertEquals(new String(word),new String(decode),"AES encode error");
29+
}
30+
31+
32+
}

springboot-starter/src/test/java/com/codingapi/springboot/framework/handler/DemoChangeLogHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import lombok.extern.slf4j.Slf4j;
55

66
@Slf4j
7+
@Handler
78
public class DemoChangeLogHandler implements IHandler<DemoChangeEvent> {
89

910
@Override

springboot-starter/src/test/java/com/codingapi/springboot/framework/handler/DemoConfiguration.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)