ToStringVerifier

Why would like to test toString method

Лицензия

Лицензия

Группа

Группа

pl.zankowski
Идентификатор

Идентификатор

tostringverifier
Последняя версия

Последняя версия

0.9.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

ToStringVerifier
Why would like to test toString method
Ссылка на сайт

Ссылка на сайт

https://github.com/WojciechZankowski/ToStringVerifier
Система контроля версий

Система контроля версий

https://github.com/WojciechZankowski/ToStringVerifier

Скачать tostringverifier

Как подключить последнюю версию

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

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
com.google.guava : guava jar 27.1-jre
org.apache.commons : commons-lang3 jar 3.9
com.flextrade.jfixture : jfixture jar 2.7.2
pl.zankowski : iextrading4j-api jar 3.1.0
org.assertj : assertj-core jar 3.12.2

provided (1)

Идентификатор библиотеки Тип Версия
org.immutables : value jar 2.7.5

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-core jar 2.27.0

Модули Проекта

Данный проект не имеет модулей.

ToStringVerifier: Useless library to verify toString method

Build Status codecov Quality Gate Maven Central

Table of Contents

Quick Start

Maven:

<dependency>
	<groupId>pl.zankowski</groupId>
	<artifactId>tostringverifier</artifactId>
	<version>0.9.1</version>
</dependency>

Gradle:

dependencies {
	compile 'pl.zankowski:tostringverifier:0.9.1'
}

Description

This is simple library to test if your generated toString method is correctly built. It means it contains all fields in the class and has the right formatting according to the selected generation type. Currently supported generation methods:

  • Guava
  • String Joiner
  • String Concat
  • String Builder
  • String Buffer
  • Apache Lang3

Generally this library is useless.

How to

Strict verification - verifies if whole string, so it also takes order of fields into the consideration

ToStringVerifier.forClass(YourObject.class)
        .withGeneratorType(GeneratorType.GUAVA_18_PLUS)
        .withStrictVerification()
        .verify();

Not strict verification - just checks if all fields are in the toString output and it prefix and suffix of the string is correct.

ToStringVerifier.forClass(YourObject.class)
        .withGeneratorType(GeneratorType.GUAVA_18_PLUS)
        .verify();

License

Code and documentation released under the Apache License, Version 2.0

Версии библиотеки

Версия
0.9.1
0.9.0