-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014-2018 Yegor Bugayenko | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package org.takes.tk; | ||
|
||
import com.jcabi.http.request.JdkRequest; | ||
import com.jcabi.http.response.RestResponse; | ||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.URI; | ||
import org.hamcrest.core.IsEqual; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.takes.http.FtRemote; | ||
|
||
/** | ||
* Test case for {@link TkSlf4j} when used in conjunction | ||
* with {@link FtRemote} and {@link TkEmpty}. | ||
* @author Dmitry Zaytsev (dmitry.zaytsev@gmail.com) | ||
* @author Yegor Bugayenko (yegor256@gmail.com) | ||
* @version $Id$ | ||
* @since 0.11.2 | ||
* | ||
* @todo #712:30min Prepare implementation for empty response body test and | ||
* unignore returnsAnEmptyResponseBody test to fix such error which was | ||
* reported in #712. | ||
*/ | ||
public final class TkSlf4jRemoteTest { | ||
|
||
/** | ||
* TkSlf4j can return an empty response body for {@link TkEmpty}. | ||
* @throws IOException if some I/O problem occurred. | ||
*/ | ||
@Ignore | ||
@Test | ||
public void returnsAnEmptyResponseBody() throws IOException { | ||
new FtRemote( | ||
new TkSlf4j(new TkEmpty()) | ||
).exec( | ||
new FtRemote.Script() { | ||
@Override | ||
public void exec(final URI home) throws IOException { | ||
new JdkRequest(home) | ||
.method("POST") | ||
.body().set("returnsAnEmptyResponseBody").back() | ||
.fetch() | ||
.as(RestResponse.class) | ||
.assertBody(new IsEqual<>("")) | ||
.assertStatus(HttpURLConnection.HTTP_OK); | ||
} | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d7c7ad5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
712-65dc14c7
disappeared fromsrc/test/java/org/takes/tk/TkSlf4jTest.java
, that's why I closed #731. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.