Skip to content

Commit 2c0dd74

Browse files
authored
Merge pull request bcgov#155 from sdevalapurkar/sd-code-smelling
Get code smelling better :)
2 parents 80f84b9 + 0fa435e commit 2c0dd74

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

jrcc-access-spring-boot-autoconfigure/src/test/java/ca/bc/gov/open/jrccaccess/autoconfigure/AccessPropertiesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void with_no_explicit_sender_should_return_default() {
3030
properties.setInput(new AccessProperties.PluginConfig());
3131
PluginConfig pluginConfig = properties.getInput();
3232

33-
assertEquals(pluginConfig.getSender(), Constants.UNKNOWN_SENDER);
33+
assertEquals(Constants.UNKNOWN_SENDER, pluginConfig.getSender());
3434
}
3535

3636
@Test

jrcc-access-spring-boot-autoconfigure/src/test/java/ca/bc/gov/open/jrccaccess/autoconfigure/plugins/http/DocumentControllerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void post_with_missing_sender_in_query_string_should_use_config_sender()
9898
ResponseEntity<DocumentReceivedResponse> response = sut.postDocument(null, null, null, null, null, SERVICE_UNAVAILABLE, multipartFile);
9999
assertEquals(HttpStatus.OK, response.getStatusCode());
100100
assertTrue(response.getBody().getAcknowledge());
101-
assertEquals(pluginConfig.getSender(), "test-sender-http");
101+
assertEquals("test-sender-http", pluginConfig.getSender());
102102
}
103103

104104
@Test

jrcc-access-spring-boot-autoconfigure/src/test/java/ca/bc/gov/open/jrccaccess/autoconfigure/plugins/sftp/SftpInputPropertiesTests.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,63 +22,63 @@ public void with_ssh_key_should_return_ssh_key() {
2222
public void with_remote_directory_should_return_remote_directory() {
2323
SftpInputProperties sut = new SftpInputProperties();
2424
sut.setRemoteDirectory("/upload");
25-
Assert.assertEquals(sut.getRemoteDirectory(), "/upload");
25+
Assert.assertEquals("/upload", sut.getRemoteDirectory());
2626
}
2727

2828
@Test
2929
public void with_host_should_return_host() {
3030
SftpInputProperties sut = new SftpInputProperties();
3131
sut.setHost("localhost");
32-
Assert.assertEquals(sut.getHost(), "localhost");
32+
Assert.assertEquals("localhost", sut.getHost());
3333
}
3434

3535
@Test
3636
public void with_port_should_return_integer_value_of_port() {
3737
SftpInputProperties sut = new SftpInputProperties();
3838
sut.setPort("22");
39-
Assert.assertEquals(sut.getPort(), Integer.valueOf("22"));
39+
Assert.assertEquals(Integer.valueOf("22"), sut.getPort());
4040
}
4141

4242
@Test
4343
public void with_username_should_return_username() {
4444
SftpInputProperties sut = new SftpInputProperties();
4545
sut.setUsername("user");
46-
Assert.assertEquals(sut.getUsername(), "user");
46+
Assert.assertEquals("user", sut.getUsername());
4747
}
4848

4949
@Test
5050
public void with_password_should_return_password() {
5151
SftpInputProperties sut = new SftpInputProperties();
5252
sut.setPassword("pass");
53-
Assert.assertEquals(sut.getPassword(), "pass");
53+
Assert.assertEquals("pass", sut.getPassword());
5454
}
5555

5656
@Test
5757
public void with_cron_should_return_cron() {
5858
SftpInputProperties sut = new SftpInputProperties();
5959
sut.setCron("0/5 * * * * *");
60-
Assert.assertEquals(sut.getCron(), "0/5 * * * * *");
60+
Assert.assertEquals("0/5 * * * * *", sut.getCron());
6161
}
6262

6363
@Test
6464
public void with_filter_pattern_should_return_filter_pattern() {
6565
SftpInputProperties sut = new SftpInputProperties();
6666
sut.setFilterPattern("filter-pattern");
67-
Assert.assertEquals(sut.getFilterPattern(), "filter-pattern");
67+
Assert.assertEquals("filter-pattern", sut.getFilterPattern());
6868
}
6969

7070
@Test
7171
public void with_max_message_per_poll_should_return_max_message_per_poll() {
7272
SftpInputProperties sut = new SftpInputProperties();
7373
sut.setMaxMessagePerPoll("5");
74-
Assert.assertEquals(sut.getMaxMessagePerPoll(), "5");
74+
Assert.assertEquals("5", sut.getMaxMessagePerPoll());
7575
}
7676

7777
@Test
7878
public void with_ssh_private_passphrase_should_return_ssh_private_passphrase() {
7979
SftpInputProperties sut = new SftpInputProperties();
8080
sut.setSshPrivatePassphrase("passphrase");
81-
Assert.assertEquals(sut.getSshPrivatePassphrase(), "passphrase");
81+
Assert.assertEquals("passphrase", sut.getSshPrivatePassphrase());
8282
}
8383

8484
@Test
@@ -103,19 +103,19 @@ public void default_get_known_hosts_return_null() {
103103
@Test
104104
public void default_get_host_returns_localhost() {
105105
SftpInputProperties sut = new SftpInputProperties();
106-
Assert.assertEquals(sut.getHost(), "localhost");
106+
Assert.assertEquals("localhost", sut.getHost());
107107
}
108108

109109
@Test
110110
public void default_get_port_returns_22() {
111111
SftpInputProperties sut = new SftpInputProperties();
112-
Assert.assertEquals(sut.getPort(), Integer.valueOf("22"));
112+
Assert.assertEquals(Integer.valueOf("22"), sut.getPort());
113113
}
114114

115115
@Test
116116
public void default_get_filter_pattern_returns_empty_string() {
117117
SftpInputProperties sut = new SftpInputProperties();
118-
Assert.assertEquals(sut.getFilterPattern(), "");
118+
Assert.assertEquals("", sut.getFilterPattern());
119119
}
120120

121121
@Test

0 commit comments

Comments
 (0)