Skip to content

Commit

Permalink
Use TestNG instead of JUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Oct 3, 2017
1 parent 95687f9 commit 4769de5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import junit.framework.Assert;
import net.shibboleth.metadata.ErrorStatus;
import net.shibboleth.metadata.Item;
import net.shibboleth.metadata.validate.Validator;
Expand All @@ -22,10 +22,10 @@ public void validate() throws Exception {

final Item<String> item = new MockItem("test");
final Validator.Action action = v.validate("foo", item, "stage");
Assert.assertEquals(Action.DONE, action);
Assert.assertEquals(action, Action.DONE);

final List<ErrorStatus> errs = item.getItemMetadata().get(ErrorStatus.class);
Assert.assertEquals(0, errs.size());
Assert.assertEquals(errs.size(), 0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import junit.framework.Assert;
import net.shibboleth.metadata.ErrorStatus;
import net.shibboleth.metadata.Item;
import net.shibboleth.metadata.validate.Validator;
Expand All @@ -22,14 +22,14 @@ public void validate() throws Exception {

final Item<String> item = new MockItem("test");
final Validator.Action action = v.validate("foo", item, "stage");
Assert.assertEquals(Action.DONE, action);
Assert.assertEquals(action, Action.DONE);

final List<ErrorStatus> errs = item.getItemMetadata().get(ErrorStatus.class);
Assert.assertEquals(1, errs.size());
Assert.assertEquals(errs.size(), 1);

final ErrorStatus err = errs.get(0);
Assert.assertEquals("stage/comp", err.getComponentId());
Assert.assertEquals("value rejected: 'foo'", err.getStatusMessage());
Assert.assertEquals(err.getComponentId(), "stage/comp");
Assert.assertEquals(err.getStatusMessage(), "value rejected: 'foo'");
}

@Test
Expand All @@ -41,14 +41,14 @@ public void validateWithMessage() throws Exception {

final Item<String> item = new MockItem("test");
final Validator.Action action = v.validate(new Double(1.25), item, "stage");
Assert.assertEquals(Action.DONE, action);
Assert.assertEquals(action, Action.DONE);

final List<ErrorStatus> errs = item.getItemMetadata().get(ErrorStatus.class);
Assert.assertEquals(1, errs.size());
Assert.assertEquals(errs.size(), 1);

final ErrorStatus err = errs.get(0);
Assert.assertEquals("stage/comp", err.getComponentId());
Assert.assertEquals("decimal 1.25", err.getStatusMessage());
Assert.assertEquals(err.getComponentId(), "stage/comp");
Assert.assertEquals(err.getStatusMessage(), "decimal 1.25");
}

}

0 comments on commit 4769de5

Please sign in to comment.