Skip to content

Commit cd42ae4

Browse files
committed
Minor changes
1 parent 85907d0 commit cd42ae4

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/main/java/com/codecentric/sample/store/service/external/HostService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public void expand(Customer customer) {
1919
}
2020

2121

22-
public void connect(String ipAddress) throws IOException {
22+
public void connect() throws IOException {
2323

24-
if (externalSystemProxy.connectionAvailable(ipAddress)) {
24+
if (externalSystemProxy.connectionAvailable("10.20.30.40")) {
2525
// Do something here
2626
}
2727
}

src/test/java/com/codecentric/sample/store/service/ItemServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ public void readItemDescriptionWithIOException() throws IOException {
116116
verifyStatic(times(1));
117117
StaticService.readFile(fileName);
118118

119-
assertThat(value, equalTo(""));
119+
assertThat(value, is(""));
120120
}
121121
}

src/test/java/com/codecentric/sample/store/service/external/HostServiceTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import java.io.IOException;
1010

11+
import static org.mockito.Matchers.any;
1112
import static org.mockito.Mockito.when;
1213

1314
public class HostServiceTest {
@@ -24,20 +25,18 @@ public void setUp() throws Exception {
2425
MockitoAnnotations.initMocks(this);
2526
}
2627

27-
2828
@Test(expected = IOException.class)
2929
public void testConnectionNotAvailable() throws IOException {
3030

3131
//
3232
// Given
3333
//
34-
String ipAddress = "10.20.30.40";
35-
when(externalSystemProxy.connectionAvailable(ipAddress)).thenThrow(new IOException());
34+
when(externalSystemProxy.connectionAvailable(any(String.class))).thenThrow(new IOException());
3635

3736
//
3837
// When
3938
//
40-
hostService.connect(ipAddress);
39+
hostService.connect();
4140

4241
//
4342
// Then

0 commit comments

Comments
 (0)