Skip to content

Commit afb8c16

Browse files
committed
fix for running microprofile tests in GitHub Action
1 parent bf05e00 commit afb8c16

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

hedera-microprofile/src/main/java/com/openelements/hedera/microprofile/ClientProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ private HederaNetwork getHederaNetwork() {
6464
throw new IllegalStateException("network value is null");
6565
}
6666
return HederaNetwork.findByName(network)
67-
.orElseThrow(() -> new IllegalArgumentException(
68-
"'hedera.network' property must be set to a valid value. Is '" + network + "'"));
67+
.orElse(HederaNetwork.CUSTOM);
6968
}
7069

7170
private Client createClient() {

hedera-microprofile/src/test/java/com/openelements/hedera/microprofile/test/FileClientTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.openelements.hedera.microprofile.test;
22

3+
import com.hedera.hashgraph.sdk.FileId;
34
import com.openelements.hedera.base.FileClient;
45
import com.openelements.hedera.microprofile.ClientProvider;
56
import io.helidon.microprofile.tests.junit5.AddBean;
@@ -29,7 +30,14 @@ static void setup() {
2930

3031
@Test
3132
void testFileClient() throws Exception {
33+
//given
34+
final byte[] contents = "Hello, Hedera!".getBytes();
3235
Assertions.assertNotNull(fileClient);
33-
fileClient.createFile(new byte[0]);
36+
37+
//when
38+
final FileId fileId = fileClient.createFile(contents);
39+
40+
//then
41+
Assertions.assertNotNull(fileId);
3442
}
3543
}

0 commit comments

Comments
 (0)