File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
main/java/io/specto/hoverfly/junit/core
test/java/io/specto/hoverfly/junit/core Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ SystemConfig createSystemConfig() {
3636 }
3737
3838 if (systemInfo .is64BitSystem ()) {
39- archType = ArchType .ARCH_AMD64 ;
39+ if (systemInfo .isOsLinux () && systemInfo .isArmArchitecture ()) {
40+ archType = ArchType .ARCH_ARM64 ;
41+ } else {
42+ archType = ArchType .ARCH_AMD64 ;
43+ }
4044 } else {
4145 archType = ArchType .ARCH_386 ;
4246 }
@@ -66,6 +70,7 @@ String getName() {
6670
6771 enum ArchType {
6872 ARCH_AMD64 ("amd64" ),
73+ ARCH_ARM64 ("arm64" ),
6974 ARCH_386 ("386" );
7075
7176 private final String name ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class SystemInfo {
1111 private final boolean isOsMac = SystemUtils .IS_OS_MAC ;
1212 private final boolean isOsLinux = SystemUtils .IS_OS_LINUX ;
1313 private final boolean is64BitSystem = SystemUtils .OS_ARCH .contains ("64" );
14+ private final boolean isArmArchitecture = SystemUtils .OS_ARCH .contains ("aarch" );
1415 private final String osName = SystemUtils .OS_NAME ;
1516
1617 boolean isOsWindows () {
@@ -29,6 +30,10 @@ boolean is64BitSystem() {
2930 return is64BitSystem ;
3031 }
3132
33+ boolean isArmArchitecture () {
34+ return isArmArchitecture ;
35+ }
36+
3237 String getOsName () {
3338 return osName ;
3439 }
Original file line number Diff line number Diff line change 66import org .junit .Test ;
77import org .powermock .reflect .Whitebox ;
88
9- import static io .specto .hoverfly .junit .core .SystemConfigFactory .ArchType .ARCH_386 ;
10- import static io .specto .hoverfly .junit .core .SystemConfigFactory .ArchType .ARCH_AMD64 ;
9+ import static io .specto .hoverfly .junit .core .SystemConfigFactory .ArchType .*;
1110import static io .specto .hoverfly .junit .core .SystemConfigFactory .OsName .*;
1211import static org .assertj .core .api .Assertions .assertThat ;
1312import static org .assertj .core .api .Assertions .catchThrowable ;
@@ -46,6 +45,18 @@ public void shouldCreateSystemConfigForLinux() {
4645 assertThat (systemConfig .getOsName ()).isEqualTo (LINUX );
4746 }
4847
48+ @ Test
49+ public void shouldCreateSystemConfigWithArm64BitArchType () {
50+
51+ when (systemInfo .isOsLinux ()).thenReturn (true );
52+ when (systemInfo .is64BitSystem ()).thenReturn (true );
53+ when (systemInfo .isArmArchitecture ()).thenReturn (true );
54+
55+ SystemConfig systemConfig = factory .createSystemConfig ();
56+
57+ assertThat (systemConfig .getArchType ()).isEqualTo (ARCH_ARM64 );
58+ }
59+
4960 @ Test
5061 public void shouldCreateSystemConfigForMac () {
5162
You can’t perform that action at this time.
0 commit comments