tonivade / json-fixtures

Simple json fixtures with test rules and annotations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Simple json fixtures with test rules and annotations

License:MIT License


Languages

Language:Java 100.0%