mockit

Annotation Type Injectable



  • @Retention(value=RUNTIME) @Target(value={FIELD,PARAMETER})public @interface Injectable
    Indicates that the value of a mock field or mock parameter will be an isolated mocked instance, intended to be passed or injected into the code under test. Such instances can be said to be proper mock objects, in contrast to the mocked instances of a regular @Mocked type.

    For the duration of each test where the mock field/parameter is in scope, only one injectable instance is mocked; other instances of the same mocked type are not affected. For an injectable mocked class, static methods and constructors are not mocked; only instance methods are.

    When used in combination with @Tested, the values of injectable fields and parameters will be used for automatic injection into the tested object. Additionally, this annotation can be applied to non-mocked fields of primitive or array types, which will also be used for injection.

    See Also:
    value(), Tutorial
    • Optional Element Summary

      Optional Elements 
      Modifier and TypeOptional Element and Description
      Stringvalue
      Specifies a literal value when the type of the injectable mock field/parameter is String, a primitive type, or an enum type.
    • Element Detail

      • value

        public abstract String value
        Specifies a literal value when the type of the injectable mock field/parameter is String, a primitive type, or an enum type. For a primitive type, the value provided must be convertible to it. For an enum type, the given textual value must equal the name of one of the possible enum values.

        When a value is provided for an injectable whose type is String or an enum type, said type is not mocked; otherwise, it is.

        Default:
        ""

Copyright © 2006–2014. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14