package org.collectionspace.services.id.test;
import junit.framework.TestCase;
+import org.collectionspace.services.common.repository.BadRequestException;
import org.collectionspace.services.id.*;
/**
// if any initialization of new IDParts fails
// due to invalid arguments passed to their constructors.
- public void testCurrentIDWithPartialSuppliedID() {
+ public void testCurrentIDWithPartialSuppliedID() throws BadRequestException {
generator.clear();
generator.add(new StringIDGeneratorPart("E"));
generator.add(new NumericIDGeneratorPart("1"));
}
- public void testCurrentIDWithFullSuppliedID() {
+ public void testCurrentIDWithFullSuppliedID() throws BadRequestException {
generator.clear();
generator.add(new YearIDGeneratorPart("2009"));
generator.add(new StringIDGeneratorPart("."));
assertEquals("2009.1-b", generator.newID());
}
- public void testNewIDWithTrailingConstantStringID() {
+ public void testNewIDWithTrailingConstantStringID() throws BadRequestException {
generator.clear();
generator.add(new YearIDGeneratorPart());
generator.add(new StringIDGeneratorPart("."));
assertEquals(CURRENT_YEAR + ".1-", generator.newID());
}
- public void testNewIDWithSuppliedID() {
+ public void testNewIDWithSuppliedID() throws BadRequestException {
generator.clear();
generator.add(new YearIDGeneratorPart("2009"));
generator.add(new StringIDGeneratorPart("."));