Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@ dependencies {
implementation "io.cloudquery:plugin-pb-java:0.0.5"
implementation "org.apache.arrow:arrow-vector:12.0.1"

testImplementation(platform('org.junit:junit-bom:5.10.0'))
testImplementation('org.junit.jupiter:junit-jupiter:5.10.0')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.10.0')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.10.0')

testImplementation 'org.assertj:assertj-core:3.24.2'
}

testing {
suites {
// Configure the built-in test suite
test {
// Use JUnit4 test framework
useJUnit('4.13.2')
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}

Expand Down
12 changes: 6 additions & 6 deletions lib/src/test/java/io/cloudquery/glob/GlobTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.cloudquery.glob;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.List;

import static io.cloudquery.glob.Glob.GLOB;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class GlobTest {
@Test
Expand Down Expand Up @@ -75,7 +75,7 @@ public void testGlobs() {
assertGlobMatch(pattern, "this is a ϗѾ test");
}

for(String pattern:List.of(
for (String pattern : List.of(
"test*", // Implicit substring match
"*is", // Partial match
"*no*", // Globs without a match between them
Expand All @@ -90,11 +90,11 @@ public void testGlobs() {
}

public void assertGlobMatch(String pattern, String subject) {
assertTrue(String.format("\"%s\" should match \"%s\"", pattern, subject), Glob.match(pattern, subject));
assertTrue(Glob.match(pattern, subject), String.format("\"%s\" should match \"%s\"", pattern, subject));
}

public void assertNotGlobMatch(String pattern, String subject) {
assertFalse(String.format("\"%s\" should not match \"%s\"", pattern, subject), Glob.match(pattern, subject));
assertFalse(Glob.match(pattern, subject), String.format("\"%s\" should not match \"%s\"", pattern, subject));
}

}
33 changes: 33 additions & 0 deletions lib/src/test/java/io/cloudquery/scalar/BinaryTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package io.cloudquery.scalar;

import io.cloudquery.scalar.Binary;
import io.cloudquery.scalar.ValidationException;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;


public class BinaryTest {
@Test
public void testNew() {
assertDoesNotThrow(() -> {
new Binary();
});
}

@Test
public void testNewWithValidParam() {
assertDoesNotThrow(() -> {
new Binary("abc");
});
}

@Test
public void testNewWithInvalidParam() {
assertThrows(ValidationException.class, () -> {
new Binary(false);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package io.cloudquery.schema;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class TableFilterDFSTest {
public static final List<Table> BASIC_TABLES = Stream.of("table1", "table2", "table3").map(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.cloudquery.schema;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TableFlattenTest {

Expand Down
4 changes: 2 additions & 2 deletions lib/src/test/java/io/cloudquery/schema/TableMaxTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.cloudquery.schema;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Collections;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TableMaxTest {

Expand Down
12 changes: 6 additions & 6 deletions lib/src/test/java/io/cloudquery/server/AddressTest.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.cloudquery.server;

import io.cloudquery.server.AddressConverter.Address;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class AddressTest {

private AddressConverter addressConverter;

@Before
@BeforeEach
public void setUp() {
addressConverter = new AddressConverter();
}
Expand All @@ -31,6 +31,6 @@ public void shouldThrowExceptionIfAddressNotFormattedCorrectly() {

AddressConverter addressConverter = new AddressConverter();

Assert.assertThrows(AddressConverter.AddressParseException.class, () -> addressConverter.convert(rawAddress));
assertThrows(AddressConverter.AddressParseException.class, () -> addressConverter.convert(rawAddress));
}
}
10 changes: 5 additions & 5 deletions lib/src/test/java/io/cloudquery/server/PluginServeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

import io.cloudquery.plugin.Plugin;
import io.cloudquery.server.PluginServe.PluginServeBuilder;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.util.List;


@Ignore(value = "blocking tests - only used manually to test the gRPC runs correctly")
@Disabled(value = "blocking tests - only used manually to test the gRPC runs correctly")
public class PluginServeTest {
public static final String URL = "https://sentry.url";

private Plugin plugin;

@Before
@BeforeEach
public void setUp() {
plugin = Plugin.builder("test-plugin", "0.1.0").build();
}
Expand Down