Skip to content

Commit 1fff516

Browse files
committed
chore: add build checks and fix formatting
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 03fe359 commit 1fff516

File tree

4 files changed

+68
-63
lines changed

4 files changed

+68
-63
lines changed

.github/workflows/check_push.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,7 @@ jobs:
122122
- name: Build Lesson 14 with Java
123123
working-directory: ./lesson_14/exceptions
124124
run: ./gradlew assemble
125+
126+
- name: Build Lesson 15 with Java
127+
working-directory: ./lesson_15/tdd
128+
run: ./gradlew check
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
package com.codedifferently.lesson15;
22

33
public class Employee {
4-
private int id;
5-
private String name;
6-
private String department;
7-
private double salary;
8-
9-
public Employee(int id, String name, String department, double salary) {
10-
this.id = id;
11-
this.name = name;
12-
this.department = department;
13-
this.salary = salary;
14-
}
15-
16-
// Getters and setters
17-
public int getId() {
18-
return id;
19-
}
20-
21-
public void setId(int id) {
22-
this.id = id;
23-
}
24-
25-
public String getName() {
26-
return name;
27-
}
28-
29-
public void setName(String name) {
30-
this.name = name;
31-
}
32-
33-
public String getDepartment() {
34-
return department;
35-
}
36-
37-
public void setDepartment(String department) {
38-
this.department = department;
39-
}
40-
41-
public double getSalary() {
42-
return salary;
43-
}
44-
45-
public void setSalary(double salary) {
46-
this.salary = salary;
47-
}
4+
private int id;
5+
private String name;
6+
private String department;
7+
private double salary;
8+
9+
public Employee(int id, String name, String department, double salary) {
10+
this.id = id;
11+
this.name = name;
12+
this.department = department;
13+
this.salary = salary;
14+
}
15+
16+
// Getters and setters
17+
public int getId() {
18+
return id;
19+
}
20+
21+
public void setId(int id) {
22+
this.id = id;
23+
}
24+
25+
public String getName() {
26+
return name;
27+
}
28+
29+
public void setName(String name) {
30+
this.name = name;
31+
}
32+
33+
public String getDepartment() {
34+
return department;
35+
}
36+
37+
public void setDepartment(String department) {
38+
this.department = department;
39+
}
40+
41+
public double getSalary() {
42+
return salary;
43+
}
44+
45+
public void setSalary(double salary) {
46+
this.salary = salary;
47+
}
4848
}

lesson_15/tdd/tdd_app/src/main/java/com/codedifferently/lesson15/EmployeeManager.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44
import java.util.Map;
55

66
public class EmployeeManager {
7-
private Map<Integer, Employee> employees;
7+
private Map<Integer, Employee> employees;
88

9-
public EmployeeManager() {
10-
employees = new HashMap<>();
11-
}
9+
public EmployeeManager() {
10+
employees = new HashMap<>();
11+
}
1212

13-
public void addEmployee(Employee employee) {
14-
employees.put(employee.getId(), employee);
15-
}
13+
public void addEmployee(Employee employee) {
14+
employees.put(employee.getId(), employee);
15+
}
1616

17-
public Employee getEmployee(int id) {
18-
return employees.get(id);
19-
}
17+
public Employee getEmployee(int id) {
18+
return employees.get(id);
19+
}
2020

21-
public void updateEmployee(Employee employee) {
22-
employees.put(employee.getId(), employee);
23-
}
21+
public void updateEmployee(Employee employee) {
22+
employees.put(employee.getId(), employee);
23+
}
2424

25-
public void removeEmployee(int id) {
26-
employees.remove(id);
27-
}
25+
public void removeEmployee(int id) {
26+
employees.remove(id);
27+
}
2828

29-
public int getEmployeeCount() {
30-
return employees.size();
31-
}
29+
public int getEmployeeCount() {
30+
return employees.size();
31+
}
3232
}

lesson_15/tdd/tdd_app/src/test/java/com/codedifferently/lesson15/Lesson15Test.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.codedifferently.lesson15;
22

33
import static org.assertj.core.api.Assertions.assertThat;
4+
45
import org.junit.jupiter.api.Test;
56

67
class Lesson15Test {

0 commit comments

Comments
 (0)