Skip to content

Commit 26409bf

Browse files
committed
removed lombok dependency
1 parent b4ebee9 commit 26409bf

File tree

11 files changed

+553
-320
lines changed

11 files changed

+553
-320
lines changed

pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@
4444
<groupId>org.springframework.boot</groupId>
4545
<artifactId>spring-boot-starter-actuator</artifactId>
4646
</dependency>
47-
<dependency>
48-
<groupId>org.projectlombok</groupId>
49-
<artifactId>lombok</artifactId>
50-
<version>1.16.6</version>
51-
<scope>provided</scope>
52-
</dependency>
53-
<dependency>
47+
<dependency>
5448
<groupId>joda-time</groupId>
5549
<artifactId>joda-time</artifactId>
5650
</dependency>

src/main/java/io/shiftleft/controller/AccountController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
package io.shiftleft.controller;
22

3+
import io.shiftleft.data.DataLoader;
34
import io.shiftleft.model.Account;
45
import javax.servlet.http.HttpServletRequest;
56
import javax.servlet.http.HttpServletResponse;
67

78
import io.shiftleft.repository.AccountRepository;
8-
import lombok.extern.slf4j.Slf4j;
9+
10+
import org.slf4j.Logger;
11+
import org.slf4j.LoggerFactory;
912
import org.springframework.beans.factory.annotation.Autowired;
1013
import org.springframework.web.bind.annotation.*;
1114

1215

1316
/**
1417
* Admin checks login
1518
*/
16-
@Slf4j
19+
1720
@RestController
1821
public class AccountController {
1922
@Autowired
2023
private AccountRepository accountRepository;
2124

25+
private static Logger log = LoggerFactory.getLogger(DataLoader.class);
26+
2227
@GetMapping("/account")
2328
public Iterable<Account> getAccountList(HttpServletResponse response, HttpServletRequest request) {
2429
response.addHeader("test-header-detection", new Account().toString());

src/main/java/io/shiftleft/controller/CustomerController.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import org.apache.http.impl.client.CloseableHttpClient;
3636
import org.apache.http.impl.client.HttpClients;
3737
import org.joda.time.DateTime;
38+
import org.slf4j.Logger;
39+
import org.slf4j.LoggerFactory;
3840
import org.springframework.beans.factory.annotation.Autowired;
3941
import org.springframework.context.annotation.Configuration;
4042
import org.springframework.context.annotation.PropertySource;
@@ -52,18 +54,18 @@
5254

5355
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
5456

57+
import io.shiftleft.data.DataLoader;
5558
import io.shiftleft.exception.CustomerNotFoundException;
5659
import io.shiftleft.exception.InvalidCustomerRequestException;
5760
import io.shiftleft.model.Customer;
5861
import io.shiftleft.repository.CustomerRepository;
5962

60-
import lombok.extern.slf4j.Slf4j;
6163
import org.springframework.web.util.HtmlUtils;
6264

6365
/**
6466
* Customer Controller exposes a series of RESTful endpoints
6567
*/
66-
@Slf4j
68+
6769
@Configuration
6870
@EnableEncryptableProperties
6971
@PropertySource({ "classpath:config/application-sfdc.properties" })
@@ -75,6 +77,8 @@ public class CustomerController {
7577

7678
@Autowired
7779
Environment env;
80+
81+
private static Logger log = LoggerFactory.getLogger(CustomerController.class);
7882

7983
@PostConstruct
8084
public void init() {

src/main/java/io/shiftleft/controller/PatientController.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package io.shiftleft.controller;
22

3+
import io.shiftleft.data.DataLoader;
34
import io.shiftleft.model.Patient;
45
import io.shiftleft.repository.PatientRepository;
5-
import lombok.extern.slf4j.Slf4j;
6+
7+
import org.slf4j.Logger;
8+
import org.slf4j.LoggerFactory;
69
import org.springframework.beans.factory.annotation.Autowired;
710

811
import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,10 +15,11 @@
1215
/**
1316
* Admin checks login
1417
*/
15-
@Slf4j
18+
1619
@RestController
1720
public class PatientController {
1821

22+
private static Logger log = LoggerFactory.getLogger(PatientController.class);
1923

2024
@Autowired
2125
private PatientRepository patientRepository;

src/main/java/io/shiftleft/data/DataLoader.java

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
import java.util.Properties;
55

66
import io.shiftleft.model.Patient;
7+
78
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
89
import org.jasypt.properties.EncryptableProperties;
10+
import org.slf4j.Logger;
11+
import org.slf4j.LoggerFactory;
912
import org.springframework.beans.factory.annotation.Autowired;
1013
import org.springframework.boot.CommandLineRunner;
1114
import org.springframework.context.annotation.Configuration;
@@ -20,84 +23,82 @@
2023
import io.shiftleft.repository.CustomerRepository;
2124
import io.shiftleft.repository.PatientRepository;
2225

23-
24-
import lombok.extern.slf4j.Slf4j;
25-
26-
@Slf4j
2726
@Component
2827
@Configuration
2928
@EnableEncryptableProperties
3029
@PropertySource({ "classpath:config/application-aws.properties", "classpath:config/application-mysql.properties",
31-
"classpath:config/application-sfdc.properties" })
30+
"classpath:config/application-sfdc.properties" })
3231
public class DataLoader implements CommandLineRunner {
3332

34-
@Autowired
35-
private DataBuilder dataBuilder;
33+
private static Logger log = LoggerFactory.getLogger(DataLoader.class);
34+
35+
@Autowired
36+
private DataBuilder dataBuilder;
3637

37-
@Autowired
38-
Environment env;
38+
@Autowired
39+
Environment env;
3940

40-
@Autowired
41-
private CustomerRepository customerRepository;
41+
@Autowired
42+
private CustomerRepository customerRepository;
4243

43-
@Autowired
44-
private PatientRepository patientRepository;
44+
@Autowired
45+
private PatientRepository patientRepository;
4546

46-
/*
47-
* Internal workings of @EnableEncryptableProperties annotation
48-
*/
49-
private String getSecurePassword(String masterPassword) throws IOException {
50-
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
51-
encryptor.setPassword(masterPassword);
52-
Properties props = new EncryptableProperties(encryptor);
53-
props.load(this.getClass().getClassLoader().getResourceAsStream("config/application-mysql.properties"));
54-
return props.getProperty("db.password");
55-
}
47+
/*
48+
* Internal workings of @EnableEncryptableProperties annotation
49+
*/
50+
private String getSecurePassword(String masterPassword) throws IOException {
51+
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
52+
encryptor.setPassword(masterPassword);
53+
Properties props = new EncryptableProperties(encryptor);
54+
props.load(this.getClass().getClassLoader().getResourceAsStream("config/application-mysql.properties"));
55+
return props.getProperty("db.password");
56+
}
5657

57-
private boolean connectToAws() {
58+
private boolean connectToAws() {
5859

59-
log.info("Start Loading AWS Properties");
60-
log.info("AWS AccessKey is {} and SecretKey is {}", env.getProperty("aws.accesskey"),
61-
env.getProperty("aws.secretkey"));
62-
log.info("AWS Bucket is {}", env.getProperty("aws.bucket"));
63-
log.info("End Loading AWS Properties");
60+
log.info("Start Loading AWS Properties");
61+
log.info("AWS AccessKey is {} and SecretKey is {}", env.getProperty("aws.accesskey"),
62+
env.getProperty("aws.secretkey"));
63+
log.info("AWS Bucket is {}", env.getProperty("aws.bucket"));
64+
log.info("End Loading AWS Properties");
6465

65-
// Connect to AWS resources and do something
66+
// Connect to AWS resources and do something
6667

67-
return true;
68-
}
68+
return true;
69+
}
6970

70-
private boolean connectToMySQL() {
71+
private boolean connectToMySQL() {
7172

72-
log.info("Start Loading MySQL Properties");
73-
log.info("Url is {}", env.getProperty("db.url"));
74-
log.info("UserName is {}", env.getProperty("db.username"));
75-
log.info("Password is {}", env.getProperty("db.password"));
76-
log.info("End Loading MySQL Properties");
73+
log.info("Start Loading MySQL Properties");
74+
log.info("Url is {}", env.getProperty("db.url"));
75+
log.info("UserName is {}", env.getProperty("db.username"));
76+
log.info("Password is {}", env.getProperty("db.password"));
77+
log.info("End Loading MySQL Properties");
7778

78-
// Connect to DB MySQL resources and do something
79+
// Connect to DB MySQL resources and do something
7980

80-
return true;
81-
}
81+
return true;
82+
}
8283

83-
@Override
84-
public void run(String... arg0) throws Exception {
84+
@Override
85+
public void run(String... arg0) throws Exception {
8586

86-
SimpleCommandLinePropertySource ps = new SimpleCommandLinePropertySource(arg0);
87+
SimpleCommandLinePropertySource ps = new SimpleCommandLinePropertySource(arg0);
8788
String encryptor = (String) ps.getProperty("jasypt.encryptor.password");
88-
log.info("JASP Master Creds is {}", encryptor);
89+
log.info("JASP Master Creds is {}", encryptor);
8990

90-
connectToMySQL();
91+
connectToMySQL();
9192

92-
connectToAws();
93+
connectToAws();
9394

94-
log.debug("Loading test data...");
95-
for(Customer customer : dataBuilder.createCustomers()) {
96-
customerRepository.save(customer);
97-
}
98-
for (Patient patient : dataBuilder.createPatients()) {
99-
patientRepository.save(patient);
100-
}
101-
log.debug("Test data loaded...");
102-
}
95+
log.debug("Loading test data...");
96+
for (Customer customer : dataBuilder.createCustomers()) {
97+
customerRepository.save(customer);
98+
}
99+
for (Patient patient : dataBuilder.createPatients()) {
100+
patientRepository.save(patient);
101+
}
102+
log.debug("Test data loaded...");
103+
}
103104
}

src/main/java/io/shiftleft/exception/ControllerExceptionHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package io.shiftleft.exception;
22

3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
35
import org.springframework.http.HttpStatus;
46
import org.springframework.web.bind.annotation.ControllerAdvice;
57
import org.springframework.web.bind.annotation.ExceptionHandler;
68
import org.springframework.web.bind.annotation.ResponseStatus;
79

8-
import lombok.extern.slf4j.Slf4j;
10+
import io.shiftleft.controller.CustomerController;
11+
912

10-
@Slf4j
1113
@ControllerAdvice
1214
public class ControllerExceptionHandler {
1315

16+
private static Logger log = LoggerFactory.getLogger(CustomerController.class);
17+
1418
@ResponseStatus(HttpStatus.NOT_FOUND) // 404
1519
@ExceptionHandler(CustomerNotFoundException.class)
1620
public void handleNotFound(CustomerNotFoundException ex) {

0 commit comments

Comments
 (0)