Terms of Service | Privacy Policy | Cookie Policy

Commit 1f237746 authored by Uwe Plonus's avatar Uwe Plonus

Added tests for setting encoding

parent a305a5e6
Pipeline #1363 passed with stages
in 20 minutes and 5 seconds
......@@ -52,21 +52,28 @@ public class GenerationConfigNGTest {
}
@Test
public void testSetSizeIsFuild() {
public void testSetSizeIsFluid() {
GenerationConfig.Builder builder = GenerationConfig.builder();
GenerationConfig.Builder b = builder.setSize(128);
assertNotNull(b, "Expected a builder to be returned by setSize.");
}
@Test
public void testSetQrcodesIsFuild() {
public void testSetEncodingIsFluid() {
GenerationConfig.Builder builder = GenerationConfig.builder();
GenerationConfig.Builder b = builder.setEncoding(EncodingConfig.builder().setType("dummy").build());
assertNotNull(b, "Expected a builder to be returned by setEncoding.");
}
@Test
public void testSetQrcodesIsFluid() {
GenerationConfig.Builder builder = GenerationConfig.builder();
GenerationConfig.Builder b = builder.setCodes(Collections.EMPTY_LIST);
assertNotNull(b, "Expected a builder to be returned by setQrcodes.");
}
@Test
public void testSetEncodingsIsFuild() {
public void testSetEncodingsIsFluid() {
GenerationConfig.Builder builder = GenerationConfig.builder();
GenerationConfig.Builder b = builder.setEncodings(Collections.EMPTY_LIST);
assertNotNull(b, "Expected a builder to be returned by setEncodings.");
......@@ -220,4 +227,19 @@ public class GenerationConfigNGTest {
assertFalse(config.getEncodings().isEmpty(), "Expected the encodings not to be empty.");
}
@Test
public void testBuildingPredefinedEncoding() {
GenerationConfig.Builder builder = GenerationConfig.builder();
GenerationConfig.Builder b = builder.setSize(8);
b = b.setEncoding(EncodingConfig.builder().setType("base64").build());
b = b.setCodes(Collections.singletonList(CodeConfig.builder()
.setType("qrcode")
.setEncoding(EncodingConfig.builder().setType("hex").build())
.setUrl("https://example.org/{code}")
.build()));
b = b.setEncodings(Collections.singletonList(EncodingConfig.builder().setType("base58").build()));
GenerationConfig config = b.build();
assertFalse(config.getEncodings().isEmpty(), "Expected the encodings not to be empty.");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment