Skip to content

Commit

Permalink
#65 - Added json-core for pitest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
starnowski committed Dec 15, 2023
1 parent 17ad7bd commit 67155d0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: ./mvnw -DskipTests --quiet clean install && ./mvnw test

- name: Run mutation tests
run: ./mvnw -pl :hibernate5,:core -P pitest test org.pitest:pitest-maven:mutationCoverage
run: ./mvnw -pl :hibernate5,:core,:json-core -P pitest test org.pitest:pitest-maven:mutationCoverage

# Executing gmavenplus plugin
# https://github.com/groovy/GMavenPlus/issues/43
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ public Context get(){
if (jsonbAnyArrayStringsExistFunctionReference != null) {
builder = builder.withJsonbAnyArrayStringsExistFunctionReference(jsonbAnyArrayStringsExistFunctionReference);
}
String schema = systemPropertyReader.read(SCHEMA_PROPERTY);
if (schema != null) {
builder = builder.withSchema(schema);
}
builder = builder.withSchema(systemPropertyReader.read(SCHEMA_PROPERTY));
return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.github.starnowski.posjsonhelper.core.sql

import spock.lang.Specification
import spock.lang.Unroll

class DefaultSQLDefinitionTest extends Specification {

@Unroll
def "should set correct properties via constructor, #createScript, #dropScript, #checkingStatements"()
{
when:
def result = new DefaultSQLDefinition(createScript, dropScript, checkingStatements)

then:
result.getCreateScript() == createScript
result.getDropScript() == dropScript
result.getCheckingStatements() == checkingStatements

where:
createScript | dropScript | checkingStatements
"crate something" | "drop something" | ["check 1", "check 2"]
}

def "should throw exception when checking statement is null"()
{
when:
def result = new DefaultSQLDefinition("crate something", "drop something", null)

then:
def ex = thrown(IllegalArgumentException)
ex.message == "checkingStatements can not be null"
}
}

0 comments on commit 67155d0

Please sign in to comment.