Skip to content

Commit

Permalink
test: refactor device info parsing tests for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyexyz committed Nov 18, 2024
1 parent e8d0190 commit 0cedd8a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package run.halo.app.security.device;

import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -18,12 +18,15 @@ class DeviceServiceImplTest {
static Stream<Arguments> deviceInfoParseTest() {
return Stream.of(
Arguments.of(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like "
+ "Gecko) Chrome/126.0.0.0 Safari/537.36",
"Mac OS X 10.15.7",
"Chrome 126.0"
),
Arguments.of(
"Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile HuaweiBrowser/5.0.4.300",
"Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) "
+ "Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile HuaweiBrowser/5.0.4"
+ ".300",
"OpenHarmony 5.0",
"Chrome 114.0"
)
Expand Down

0 comments on commit 0cedd8a

Please sign in to comment.