Skip to content

Commit

Permalink
refactor(teams): use string for jacketNr
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Apr 1, 2024
1 parent 2e1264e commit eee127d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/telraam/database/models/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Team {
private Integer id;
private String name;
private Integer batonId;
private Integer jacketNr;
private String jacketNr = "0";

public Team(String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
alter table team add jacket_nr integer default 0 not null;
alter table team add jacket_nr varchar(255) default '0' not null;
4 changes: 2 additions & 2 deletions src/test/java/telraam/database/daos/TeamDAOTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ void testUpdateDoesUpdate() {
int testid = teamDAO.insert(testTeam);
testTeam.setId(testid);
testTeam.setName("postupdate");
testTeam.setJacketNr(10);
testTeam.setJacketNr("10");
int updatedRows = teamDAO.update(testid, testTeam);
assertEquals(1, updatedRows);

Optional<Team> dbTeam = teamDAO.getById(testid);
assertFalse(dbTeam.isEmpty());
assertEquals("postupdate", dbTeam.get().getName());
assertEquals(10, dbTeam.get().getJacketNr());
assertEquals("10", dbTeam.get().getJacketNr());
}

@Test
Expand Down

0 comments on commit eee127d

Please sign in to comment.