Skip to content

Commit

Permalink
Merge pull request #112 from diffblue/mjlodge-patch-1
Browse files Browse the repository at this point in the history
Fix up corebanking so it works better
  • Loading branch information
mjlodge committed Jul 8, 2023
2 parents 940593f + 00b1d5b commit 16a9ad9
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 7 deletions.
64 changes: 59 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,50 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.diffblue.corebanking</groupId>
<artifactId>CoreBanking</artifactId>
<version>1.0.0</version>
<version>1.0.1-JUnit5</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jacoco.version>0.8.5</jacoco.version>
</properties>
<dependencies>
<!-- Only for JCover -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<version>0.8.2</version>
<scope>test</scope>
<classifier>runtime</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<!-- DIFFBLUE -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.5.2</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.12</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down Expand Up @@ -52,7 +80,33 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.0.0-M3</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/diffblue/corebanking/account/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void takeFromBalance(final long amount) throws AccountException {
if (getAccountState() != AccountState.OPEN) {
throw new AccountException("Cannot take from balance, account is closed.");
}
if (currentBalance + amount < 0) {
if (currentBalance - amount < 0) {
throw new AccountException(
"Trying to take "
+ amount
Expand Down Expand Up @@ -208,7 +208,7 @@ public class AccountStatement {
private final List<Transaction> transactions;

/** Constructor. */
private AccountStatement() {
public AccountStatement() {
transactions = new ArrayList<Transaction>();
}

Expand Down

0 comments on commit 16a9ad9

Please sign in to comment.