File tree Expand file tree Collapse file tree
main/java/com/codecentric/sample/store/service/external
test/java/com/codecentric/sample/store/service Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 88
99import java .io .IOException ;
1010
11+ import static org .mockito .Matchers .any ;
1112import static org .mockito .Mockito .when ;
1213
1314public 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
You can’t perform that action at this time.
0 commit comments