private JDocComment addBaseJavaDoc(final Action action, final JMethod method) { final JDocComment javadoc = method.javadoc(); if (isNotBlank(action.getDescription())) { javadoc.add(action.getDescription()); } return javadoc; }
/** * <p>addBaseJavaDoc.</p> * * @param action a {@link org.raml.model.Action} object. * @param method a {@link com.sun.codemodel.JMethod} object. * @return a {@link com.sun.codemodel.JDocComment} object. */ protected JDocComment addBaseJavaDoc(final Action action, final JMethod method) { final JDocComment javadoc = method.javadoc(); if (isNotBlank(action.getDescription())) { javadoc.add(action.getDescription()); } return javadoc; }
@Override public MethodSpec methodSpec() { ParameterSpec handler = ParameterSpec.builder( ParameterizedTypeName.get(ClassName.get(Function.class), ClassName.get(Response.class), ClassName.bestGuess("T")), "handler").build(); return MethodSpec.methodBuilder(isNotEmpty(name) ? name : httpMethod) .addModifiers(Modifier.PUBLIC) .addTypeVariable(TypeVariableName.get("T")) .returns(ClassName.bestGuess("T")) .addJavadoc("$L\n", trimToEmpty(action.getDescription())) .addParameter(handler) .addStatement("return $L.apply($T.given().spec($L.build()).expect().spec($L.build()).when().$L($L))", handler.name, RestAssured.class, reqFieldName, respFieldName, httpMethod, uriConst ).build(); } }
Action action = entry.getValue(); Operation operation = new Operation(); operation.setDescription(action.getDescription()); operation.setMethod(entry.getKey().name().toString());
Action action = entry.getValue(); Operation operation = new Operation(); operation.setDescription(action.getDescription()); operation.setMethod(entry.getKey().name().toString());
Action action = entry.getValue(); Operation operation = new Operation(); operation.setDescription(action.getDescription()); operation.setMethod(entry.getKey().name().toString());
Action action = entry.getValue(); Operation operation = new Operation(); operation.setDescription(action.getDescription()); operation.setMethod(entry.getKey().name().toString());
Action action = entry.getValue(); Operation operation = new Operation(); operation.setDescription(action.getDescription()); operation.setMethod(entry.getKey().name().toString());
private void action(Action action) { locator.action(action); checker.parameters(action.getBaseUriParameters(), BASE_URI); checker.parameters(action.getQueryParameters(), QUERY); checker.headerPattern(action.getHeaders().keySet()); checker.description(action.getDescription()); checker.description(action.getBaseUriParameters(), BASE_URI); checker.description(action.getQueryParameters(), QUERY); checker.description(action.getHeaders(), HEADER); checker.empty(action); if (action.getBody() != null) { for (final MimeType mimeType : action.getBody().values()) { locator.requestMime(mimeType); mimeType(mimeType); } } for (final Map.Entry<String, Response> entry : action.getResponses().entrySet()) { locator.responseCode(entry.getKey()); response(entry.getValue()); } }
.description(source.getDescription())//