use of ru.sbtqa.tag.api.annotation.Mutator in project page-factory-2 by sbtqa.
the class MutatorApplicator method getMutator.
private Method getMutator(EndpointEntry endpoint, Field field) {
Mutator mutator = field.getAnnotation(Mutator.class);
Class container = mutator.clazz() == EmptyClass.class ? endpoint.getClass() : mutator.clazz();
Method setter = Arrays.stream(container.getMethods()).filter(method -> Objects.equals(method.getName(), mutator.method())).findFirst().orElseThrow(() -> new RestPluginException(format("Mutator method \"%s\" is not found", mutator.method())));
setter.setAccessible(true);
return setter;
}
Aggregations