New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RtContainersTestCase.java:33-35: Write unit tests for all... #47
Comments
Job #47 is now in scope, role is |
@amihaiemil what's the url? @param container Json config as specified in the API's docs. Would be nice if we added to the javadocs: @see <a href="api_doc_url">Docker API</a> |
@llorllale right; this is the URL: https://docs.docker.com/engine/api/v1.30/#operation/ContainerCreate The API docs is for 1.30; I guess it won't change that much in future versions. Besides, whoever knows how to read it will also know to check the right version they need :) |
@amihaiemil I'm think about creating The idea is to provide an easy way to specify an eg.: new AssertRequest(
new Response(HttpStatus.SC_OK, "json_payload"),
conditions...
) |
@amihaiemil here's an example of what this might all look like: /**
* Should create container if request valid and no error is returned from
* the Docker API.
*
* @throws Exception unexpected
*/
@Test
public void createContainerFromImageName() throws Exception {
MatcherAssert.assertThat(
new RtContainers(
new AssertRequest(
new Response(
HttpStatus.SC_CREATED, "{ \"Id\": \"df2419f4\" }"
),
new Condition(
"The 'Content-Type' header must be set.",
req -> req.getHeaders("Content-Type").length > 0
),
new Condition(
"Content-Type must be 'application/json'.",
// @checkstyle LineLength (1 line)
req -> "application/json".equals(req.getHeaders("Content-Type")[0].getValue())
),
new Condition(
"Resource path must be /containers/create",
// @checkstyle LineLength (1 line)
req -> req.getRequestLine().getUri().endsWith("/containers/create")
)
), URI.create("http://localhost/test")
).create("some_image"),
Matchers.notNullValue()
);
} |
@llorllale Yeah, seems like a good idea :) |
* Added some tests for RtContainers * Added new test support classes 'Response' and 'PayloadOf' * Fixed typo in 'ContainerCreate' API endpoint in RtContainers
As per PR review: * Fixed javadoc for PayloadOf * Fixed endpoint test for RtContainers
The puzzle |
Order was finished: +30 points just awarded to @llorllale/z |
The job #47 is now out of scope |
The puzzle
26-a8980bc9
from #26 has to be resolved:docker-java-api/src/test/java/com/amihaiemil/docker/RtContainersTestCase.java
Lines 33 to 35 in f5a14a6
The puzzle was created by amihaiemil on 13-Mar-18.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
The text was updated successfully, but these errors were encountered: