Skip to content

Commit 284b278

Browse files
committed
#165: Code Refactoring
1 parent d2c9b19 commit 284b278

File tree

4 files changed

+5
-83
lines changed

4 files changed

+5
-83
lines changed

pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@
114114
<artifactId>spring-boot-starter-validation</artifactId>
115115
</dependency>
116116

117-
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
118-
<dependency>
119-
<groupId>org.springframework.boot</groupId>
120-
<artifactId>spring-boot-starter-security</artifactId>
121-
<version>3.1.3</version>
122-
</dependency>
117+
123118

124119
<dependency>
125120
<groupId>org.glassfish.jaxb</groupId>

src/main/java/de/doubleslash/keeptime/view/LoginController.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ public LoginController(final String username, final String password) {
1313
this.password = password;
1414
}
1515

16-
public String getUsername() {
17-
username = extractValue(properties.getProperty("spring.security.user.name"));
18-
19-
return username;
20-
}
21-
22-
public String getPassword() {
23-
password = extractValue(properties.getProperty("spring.security.user.password"));
24-
return password;
25-
}
26-
27-
public void setUsername(final String username) {
28-
this.username = username;
29-
}
30-
31-
public void setPassword(final String password) {
32-
this.password = password;
33-
}
34-
3516
public void createAndSaveUser() {
3617
properties.setProperty("spring.security.user.name", "${BASIC_AUTH_USER:" + this.username + "}");
3718
properties.setProperty("spring.security.user.password", "${BASIC_AUTH_PASSWORD:" + this.password + "}");

src/test/java/de/doubleslash/keeptime/REST_API_Test/ApiTest.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/test/java/de/doubleslash/keeptime/view/LoginControllerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public void testExtractValuePassword() {
3131

3232
@Test
3333
public void testCreateAndSaveUser() {
34-
String username = "testUser";
35-
String password = "testPassword";
34+
String username = "User";
35+
String password = "123A";
3636
LoginController loginController = new LoginController(username, password);
3737

3838
loginController.createAndSaveUser();
3939
Properties properties = loginController.properties;
40-
assertEquals("${BASIC_AUTH_USER:testUser}", properties.getProperty("spring.security.user.name"));
41-
assertEquals("${BASIC_AUTH_PASSWORD:testPassword}", properties.getProperty("spring.security.user.password"));
40+
assertEquals("${BASIC_AUTH_USER:User}", properties.getProperty("spring.security.user.name"));
41+
assertEquals("${BASIC_AUTH_PASSWORD:123A}", properties.getProperty("spring.security.user.password"));
4242
}
4343
}
4444

0 commit comments

Comments
 (0)