@DTO(MockModels.class) Model modelWithWrongDTO();
/** * Support the same type that the one that has been parameterized when implementing the {@link Mockery.Behaviour} interface. */ @Override public Type[] supportedTypes(Metadata<DTO> metadata) { DTO dto = metadata.getAnnotation(); ParameterizedType behaviourInterfaceType = null; for (Type type : dto.value().getGenericInterfaces()) { if (!(type instanceof ParameterizedType)) continue; Class<?> interfaceClass = (Class) ((ParameterizedType)type).getRawType(); if (DTO.Behaviour.class.isAssignableFrom(interfaceClass)) { behaviourInterfaceType = (ParameterizedType) type; break; } } Type supportedType = behaviourInterfaceType.getActualTypeArguments()[0]; Type[] types = {supportedType}; return types; }
@DTO(MockModels.class) Single<List<Model>> modelsWithParamWithoutMockery(Integer i1);
/** * Provide a legal value deferring to the {@link Mockery.Behaviour} implementation supplied. */ @Override public Object legal(Metadata<DTO> metadata) { DTO dto = metadata.getAnnotation(); DTO.Behaviour behaviour = instantiateInterface.from(dto.value()); return behaviour.legal(); }
@DTO(MockModel.class) Call<Model> model();
/** * Perform validation upon {@code candidate} deferring to the {@link Mockery.Behaviour} implementation supplied. */ @Override public void validate(Metadata<DTO> metadata, Object candidate) throws AssertionError { DTO dto = metadata.getAnnotation(); DTO.Behaviour behaviour = instantiateInterface.from(dto.value()); behaviour.validate(candidate); }
@DTO(DTOListMock.class) String DTOListMock();
@DTO(DTOMapMock.class) String DTOMapMockMock(); }
@DTO(MockModel.class) Single<Response<Model>> modelResponse(); }
@DTO(DTORawListMock.class) String DTORawListMock();
@DTO(MockModel.class) Model model();
@DTO(MockModels.class) Call<List<Model>> modelsWithParamWithoutMockery(Integer i1);
@DTO(MockModel.class) Observable<Model> model();
@DTO(MockModel.class) Single<Model> model();
@DTO(MockModels.class) List<Model> models();
@DTO(MockModel.class) Model modelWithoutSingle();
@DTO(MockModels.class) Single<Model> modelWithWrongDTO();
@DTO(MockModel.class) Single<Response<Model>> modelResponse();