Skip to content
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

Error during pact generation for feign when private static final fields present in DTO #77

Open
wlodarcp opened this issue Jul 27, 2020 · 0 comments

Comments

@wlodarcp
Copy link
Collaborator

Following error occurs during pact generation for feign when private static final fields present in DTO:

Condition failed with Exception:

pactGenerator.writePactFiles("com.hltech.feecollector", "fee-collector", objectMapper, new File("build/pacts/"))
|             |                                                          |             |
|             |                                                          |             build\pacts
|             |                                                          <com.fasterxml.jackson.databind.ObjectMapper@7e911b96 _jsonFactory=com.fasterxml.jackson.databind.MappingJsonFactory@686ca28b _typeFactory=com.fasterxml.jackson.databind.type.TypeFactory@2ac05f10 _injectableValues=null _subtypeResolver=com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver@2ecef544 _configOverrides=com.fasterxml.jackson.databind.cfg.ConfigOverrides@6de1752 _mixIns=com.fasterxml.jackson.databind.introspect.SimpleMixInResolver@78c74eb3 _serializationConfig=com.fasterxml.jackson.databind.SerializationConfig@1e038a _serializerProvider=com.fasterxml.jackson.databind.ser.DefaultSerializerProvider$Impl@5923a218 _serializerFactory=com.fasterxml.jackson.databind.ser.BeanSerializerFactory@2fb15ae9 _deserializationConfig=com.fasterxml.jackson.databind.DeserializationConfig@6d413b7a _deserializationContext=com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl@1d33670b _registeredModuleTypes=[com.fasterxml.jackson.datatype.jsr310.JavaTimeModule] _rootDeserializers=[[simple type, class com.fasterxml.jackson.databind.JsonNode]:com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer@59c435d7]>
|             com.hltech.pact.gen.domain.pact.PojoNonCompliantWithPodamException: Unable to instantiate NotSupportedDto object with podam due to missing noArgsConstructor + setters / allArgsConstructor
<com.hltech.pact.gen.PactGenerator@6015f8c0 feignClientsFinder=com.hltech.pact.gen.domain.client.feign.FeignClientsFinder@101a5e88 pactFactory=com.hltech.pact.gen.domain.pact.PactFactory@5f8667b3 pactJsonGenerator=com.hltech.pact.gen.domain.pact.PactJsonGenerator@2228fc28>

Sample feign client to reproduce error:

@FeignClient(name = "foo", url = "/foo")
public interface SampleFailingFeign {

    @InteractionInfo(responseStatus = OK)
    @GetMapping(value = "/foo")
    NotSupportedDto getNotSupportedDto();
}
@AllArgsConstructor
@Data
public class NotSupportedDto {
    private static final String STATIC_DATA = "Sample static";

    private String someData;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant