Skip to content

Commit

Permalink
Unify langchang4j-core coverage to a 95% requirement. (langchain4j#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
crutcher authored Jan 15, 2024
1 parent 9e251fd commit 2880fb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 66 deletions.
66 changes: 0 additions & 66 deletions langchain4j-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,72 +108,6 @@
<configuration>
<rules>
<rule>
<includes>
<include>dev.langchain4j.model.language</include>
<include>dev.langchain4j.model.moderation</include>
</includes>
<element>PACKAGE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>
</limit>
</limits>
</rule>
<rule>
<includes>
<include>dev.langchain4j.model</include>
<include>dev.langchain4j.model.output</include>
</includes>
<element>PACKAGE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.50</minimum>
</limit>
</limits>
</rule>
<rule>
<includes>
<include>dev.langchain4j.data.message</include>
<include>dev.langchain4j.model.input</include>
<include>dev.langchain4j.model.input.structured</include>
</includes>
<element>PACKAGE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
</limits>
</rule>
<rule>
<includes>
<include>dev.langchain4j.internal</include>
</includes>
<element>PACKAGE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.90</minimum>
</limit>
</limits>
</rule>
<rule>
<excludes>
<exclude>dev.langchain4j.data.message</exclude>
<exclude>dev.langchain4j.internal</exclude>
<exclude>dev.langchain4j.model</exclude>
<exclude>dev.langchain4j.model.input</exclude>
<exclude>dev.langchain4j.model.input.structured</exclude>
<exclude>dev.langchain4j.model.moderation</exclude>
<exclude>dev.langchain4j.model.language</exclude>
<exclude>dev.langchain4j.model.output</exclude>
</excludes>
<element>PACKAGE</element>
<limits>
<limit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,21 @@ public void test_ensureBetween_int() {
.withMessageContaining("test must be between 0 and 1, but is: -1");
}
}

@Test
public void test_ensureBetween_long() {
{
ValidationUtils.ensureBetween(1L, 0, 1, "test");
}
{
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> ValidationUtils.ensureBetween(2L, 0, 1, "test"))
.withMessageContaining("test must be between 0 and 1, but is: 2");
}
{
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> ValidationUtils.ensureBetween(-1L, 0, 1, "test"))
.withMessageContaining("test must be between 0 and 1, but is: -1");
}
}
}

0 comments on commit 2880fb0

Please sign in to comment.