// Path: src/main/java/com/webfluxclient/metadata/request/RequestHeader.java
// @EqualsAndHashCode
// class BasicRequestHeader implements RequestHeader {
// 
//     private String name;
//     private String value;
// 
//     public BasicRequestHeader(String name, String value) {
//         this.name = name;
//         this.value = value;
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public List<String> getValues(Map<String, List<String>> parameterValues) {
//         return Collections.singletonList(value);
//     }
// }
// 
// Path: src/main/java/com/webfluxclient/metadata/request/RequestTemplate.java
// @Getter
// @AllArgsConstructor
// public class RequestTemplate {
//     private UriBuilder uriBuilder;
//     private HttpMethod httpMethod;
//     private RequestHeaders requestHeaders;
//     private Integer bodyIndex;
//     private ResolvableType requestBodyType;
//     private MultiValueMap<Integer, String> variableIndexToName;
// 
//     public Request apply(Object[] args) {
//         return new DefaultRequest(uriBuilder,
//                 httpMethod,
//                 requestHeaders.encode(args),
//                 nameToVariable(args),
//                 buildBody(args));
//     }
// 
//     private BodyInserter<?, ? super ClientHttpRequest> buildBody(Object[] args) {
//         if (bodyIndex == null) {
//             return BodyInserters.empty();
//         }
//         
//         Object body = args[bodyIndex];
//         if (isDataBufferPublisher(requestBodyType)) {
//             return BodyInserters.fromDataBuffers((Publisher<DataBuffer>) body);
//         } else if (isPublisher(requestBodyType)) {
//             return BodyInserters.fromPublisher((Publisher) body, requestBodyType.getGeneric(0).getRawClass());
//         } else if (isResource(requestBodyType)) {
//             return BodyInserters.fromResource((Resource) body);
//         } else if (isFormData(requestBodyType)) {
//             return BodyInserters.fromFormData((MultiValueMap<String, String>) body);
//         } else {
//             return BodyInserters.fromObject(body);
//         }
//     }
//     
//     private Map<String, Object> nameToVariable(Object[] args) {
//         Map<String, Object> nameToVariable = new HashMap<>();
//         variableIndexToName.forEach((variableIndex, variableNames) -> {
//             variableNames
//                     .forEach(variableName -> nameToVariable.put(variableName, args[variableIndex]));
//         });
//         return nameToVariable;
//     }
// }


import com.webfluxclient.metadata.request.RequestHeader.BasicRequestHeader;
import com.webfluxclient.metadata.request.RequestTemplate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.http.HttpMethod;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.util.AbstractMap.SimpleEntry;
import java.util.List;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
package com.webfluxclient.metadata;




@RunWith(MockitoJUnitRunner.class)
public class MethodMetadataFactoryTest {
    @InjectMocks
    private MethodMetadataFactory methodMetadataFactory;

    @Test
    public void processRootMethodMetadata_withSingleInterface() {
// Path: src/main/java/com/webfluxclient/metadata/request/RequestHeader.java
// @EqualsAndHashCode
// class BasicRequestHeader implements RequestHeader {
// 
//     private String name;
//     private String value;
// 
//     public BasicRequestHeader(String name, String value) {
//         this.name = name;
//         this.value = value;
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public List<String> getValues(Map<String, List<String>> parameterValues) {
//         return Collections.singletonList(value);
//     }
// }
// 
// Path: src/main/java/com/webfluxclient/metadata/request/RequestTemplate.java
// @Getter
// @AllArgsConstructor
// public class RequestTemplate {
//     private UriBuilder uriBuilder;
//     private HttpMethod httpMethod;
//     private RequestHeaders requestHeaders;
//     private Integer bodyIndex;
//     private ResolvableType requestBodyType;
//     private MultiValueMap<Integer, String> variableIndexToName;
// 
//     public Request apply(Object[] args) {
//         return new DefaultRequest(uriBuilder,
//                 httpMethod,
//                 requestHeaders.encode(args),
//                 nameToVariable(args),
//                 buildBody(args));
//     }
// 
//     private BodyInserter<?, ? super ClientHttpRequest> buildBody(Object[] args) {
//         if (bodyIndex == null) {
//             return BodyInserters.empty();
//         }
//         
//         Object body = args[bodyIndex];
//         if (isDataBufferPublisher(requestBodyType)) {
//             return BodyInserters.fromDataBuffers((Publisher<DataBuffer>) body);
//         } else if (isPublisher(requestBodyType)) {
//             return BodyInserters.fromPublisher((Publisher) body, requestBodyType.getGeneric(0).getRawClass());
//         } else if (isResource(requestBodyType)) {
//             return BodyInserters.fromResource((Resource) body);
//         } else if (isFormData(requestBodyType)) {
//             return BodyInserters.fromFormData((MultiValueMap<String, String>) body);
//         } else {
//             return BodyInserters.fromObject(body);
//         }
//     }
//     
//     private Map<String, Object> nameToVariable(Object[] args) {
//         Map<String, Object> nameToVariable = new HashMap<>();
//         variableIndexToName.forEach((variableIndex, variableNames) -> {
//             variableNames
//                     .forEach(variableName -> nameToVariable.put(variableName, args[variableIndex]));
//         });
//         return nameToVariable;
//     }
// }


// Path: src/test/java/com/webfluxclient/metadata/MethodMetadataFactoryTest.java
import com.webfluxclient.metadata.request.RequestHeader.BasicRequestHeader;
import com.webfluxclient.metadata.request.RequestTemplate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.http.HttpMethod;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.util.AbstractMap.SimpleEntry;
import java.util.List;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

package com.webfluxclient.metadata;




@RunWith(MockitoJUnitRunner.class)
public class MethodMetadataFactoryTest {
    @InjectMocks
    private MethodMetadataFactory methodMetadataFactory;

    @Test
    public void processRootMethodMetadata_withSingleInterface() {
        RequestTemplate requestTemplate = methodMetadataFactory.processTarget(ParentReactiveClient.class, URI.create("")).getRequestTemplate();