Skip to content

Commit 56454eb

Browse files
committed
Can't write should().should()
1 parent 9f90683 commit 56454eb

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

src/main/java/net/codestory/rest/RestResponseShould.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import static java.lang.String.format;
2121

22-
class RestResponseShould implements Should {
22+
class RestResponseShould implements ShouldChain {
2323
private final RestResponse response;
2424
private final boolean negate;
2525

@@ -37,7 +37,6 @@ public RestResponseShould not() {
3737

3838
// Verifications
3939

40-
// TODO: shouldn't be able to write should().should()
4140
@Override
4241
public RestResponseShould should() {
4342
return new RestResponseShould(response, false);

src/main/java/net/codestory/rest/Should.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@
1616
package net.codestory.rest;
1717

1818
public interface Should {
19-
Should should();
20-
2119
Should not();
2220

23-
Should respond(int statusCode);
21+
ShouldChain respond(int statusCode);
2422

25-
Should succeed();
23+
ShouldChain succeed();
2624

27-
Should fail();
25+
ShouldChain fail();
2826

29-
Should contain(String content);
27+
ShouldChain contain(String content);
3028

31-
Should beEmpty();
29+
ShouldChain beEmpty();
3230

33-
Should haveType(String contentType);
31+
ShouldChain haveType(String contentType);
3432

35-
Should haveCookie(String name, String value);
33+
ShouldChain haveCookie(String name, String value);
3634

37-
Should haveHeader(String name, String value);
35+
ShouldChain haveHeader(String name, String value);
3836
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (C) 2013-2014 [email protected]
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License
15+
*/
16+
package net.codestory.rest;
17+
18+
public interface ShouldChain extends Should {
19+
ShouldChain should();
20+
}

0 commit comments

Comments
 (0)