import java.net.URI;
import java.net.URISyntaxException;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
* @throws ParseException
*/
@Test
- public void getDataWithSlashesBehindMountPoint() throws Exception {
+ public void getDataWithSlashesBehindMountPoint() throws ParseException {
final YangInstanceIdentifier awaitedInstanceIdentifier = prepareInstanceIdentifierForList();
when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), eq(awaitedInstanceIdentifier),
Mockito.anyString())).thenReturn(prepareCnDataForSlashesBehindMountPointTest());
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
}
- private static YangInstanceIdentifier prepareInstanceIdentifierForList() throws Exception {
+ private static YangInstanceIdentifier prepareInstanceIdentifierForList() throws ParseException {
final List<PathArgument> parameters = new ArrayList<>();
final QName qNameCont = newTestModuleQName("cont");
return YangInstanceIdentifier.create(parameters);
}
- private static QName newTestModuleQName(final String localPart) throws Exception {
- final Date revision = new SimpleDateFormat("yyyy-MM-dd").parse("2014-01-09");
- final URI uri = new URI("test:module");
+ private static QName newTestModuleQName(final String localPart) throws ParseException {
+ final Date revision = SimpleDateFormatUtil.getRevisionFormat().parse("2014-01-09");
+ final URI uri = URI.create("test:module");
return QName.create(uri, revision, localPart);
}