Json-Fixtures

Simple json fixtures with test rules and annotations

License

License

Categories

Categories

JSON Data
GroupId

GroupId

com.github.tonivade
ArtifactId

ArtifactId

json-fixtures
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Json-Fixtures
Simple json fixtures with test rules and annotations
Project URL

Project URL

https://github.com/tonivade/json-fixtures
Source Code Management

Source Code Management

https://github.com/tonivade/json-fixtures

Download json-fixtures

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.tonivade/json-fixtures/ -->
<dependency>
    <groupId>com.github.tonivade</groupId>
    <artifactId>json-fixtures</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.tonivade/json-fixtures/
implementation 'com.github.tonivade:json-fixtures:0.2.0'
// https://jarcasting.com/artifacts/com.github.tonivade/json-fixtures/
implementation ("com.github.tonivade:json-fixtures:0.2.0")
'com.github.tonivade:json-fixtures:jar:0.2.0'
<dependency org="com.github.tonivade" name="json-fixtures" rev="0.2.0">
  <artifact name="json-fixtures" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.tonivade', module='json-fixtures', version='0.2.0')
)
libraryDependencies += "com.github.tonivade" % "json-fixtures" % "0.2.0"
[com.github.tonivade/json-fixtures "0.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
junit : junit jar 4.12
com.google.code.gson : gson jar 2.3.1

test (2)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.10.19
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

json-fixtures

Json-Fixtures is a library to simplify tests. You can define fixtures using json and load inside your tests using annotations.

Supported types:

  • Pojos
  • Arrays of pojos
  • Collections of Pojos
    • List
    • Set
    • Collection
  • Maps of Pojos

Example

@Rule
public JsonFixturesTestRule rule = new JsonFixturesTestRule(this);

@JsonFixture("/files/data.json")
public Data data;

@JsonFixture("/files/list.json")
public List<Data> dataList;

@JsonFixture("/files/list.json")
public Set<Data> dataSet;

@JsonFixture("/files/list.json")
public Collection<Data> dataCollection;

@JsonFixture("/files/list.json")
public Data[] dataArray;

@JsonFixture("/files/map.json")
public Map<String, Data> dataMap;

Build Status

Versions

Version
0.2.0