Skip to content

Commit

Permalink
unit test for toString() method as required in issue #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi R. Viggiano committed Jun 16, 2013
1 parent 072df15 commit 03055f7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/test/java/org/aeonbits/owner/ToStringTest.java
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2013, Luigi R. Viggiano
* All rights reserved.
*
* This software is distributable under the BSD license.
* See the terms of the BSD license in the documentation provided with this software.
*/

package org.aeonbits.owner;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
* @author Luigi R. Viggiano
*/
public class ToStringTest {

interface MyConfig extends Config {
@Key("max.threads")
@DefaultValue("25")
int maxThreads();

@Key("max.folders")
@DefaultValue("99")
int maxFolders();

@Key("default.name")
@DefaultValue("untitled")
String defaultName();
}

@Test
public void toStringTest() {
MyConfig cfg = ConfigFactory.create(MyConfig.class);
assertEquals("{default.name=untitled, max.folders=99, max.threads=25}", cfg.toString());
}
}

0 comments on commit 03055f7

Please sign in to comment.