Skip to content

Collection of JUnit Jupiter converters for parameterized classes and tests

License

Notifications You must be signed in to change notification settings

scordio/junit-converters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JUnit Converters Maven Central javadoc

CI

This project provides a collection of JUnit Jupiter converters for parameterized classes and tests.

Annotation Description
@Base64 Decodes Base64 encoded String instances into byte[] instances
@Hex Decodes hexadecimal String instances into byte[] instances

Getting Started

Compatibility

JUnit Converters is based on JUnit Jupiter 5 and requires Java 8 or higher.

Maven

<dependency>
  <groupId>io.github.scordio</groupId>
  <artifactId>junit-converters</artifactId>
  <version>${junit-converters.version}</version>
  <scope>test</scope>
</dependency>

Gradle

testImplementation("io.github.scordio:junit-converters:${junitConvertersVersion}")

@Base64

@Base64 decodes Base64 encoded String instances into byte[] instances.

The annotation's encoding attribute configures the desired encoding scheme, following RFC 4648 and RFC 2045:

  • BASIC: for the Basic encoding scheme (default)
  • URL: for the URL and Filename Safe encoding scheme
  • MIME: for the MIME encoding scheme

The following source types and target declarations are supported.

Source Type Target Declaration Example
String @Base64 byte[] bytes "Pz8/"new byte[] { 63, 63, 63 }
String @Base64(encoding = URL) byte[] bytes "Pz8_"new byte[] { 63, 63, 63 }
String @Base64(encoding = MIME) byte[] bytes "Pz\r\n8/"new byte[] { 63, 63, 63 }

@Hex

@Hex decodes hexadecimal String instances into byte[] instances.

The following source types and target declarations are supported.

Source Type Target Declaration Example
String @Hex byte[] bytes "0A1B2C"new byte[] { 0x0A, 0x1B, 0x2C }

License

JUnit Converters is released under version 2.0 of the Apache License.

About

Collection of JUnit Jupiter converters for parameterized classes and tests

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors 2

  •  
  •  

Languages