@Test(expected = OnapCommandInvalidSchema.class)
public void invalidateTest1() throws OnapCommandException {
-
OnapCommand cmd = new OnapCommand() {
@Override
protected void run() throws OnapCommandException {}
};
- OnapCommandSchemaLoader.loadSchema(cmd, "fdsfds.yaml", true, true);
+ try {
+ OnapCommandSchemaLoader.loadSchema(cmd, "fdsfds", true, true);
+ } catch(Exception e) {
+ assertEquals(e.getClass(), OnapCommandInvalidSchema.class);
+ }
+ OnapCommandSchemaLoader.loadSchema(cmd, "schema-invalid-file.yaml", true, true);
}
-
@Test
public void validateTestMerge() throws OnapCommandException {
@Test(expected = OnapCommandInvalidSchema.class)
public void invalidateTest2() throws OnapCommandException {
- OnapCommand cmd = new OnapCommand() {
- @Override
- protected void run() throws OnapCommandException {}
- };
- OnapCommandSchemaLoader.loadSchema(cmd, "fdsfds", true, true);
- }
-
- @Test(expected = OnapCommandInvalidSchema.class)
- public void invalidateTest4() throws OnapCommandException {
OnapCommand cmd = new OnapCommand() {
@Override
protected void run() throws OnapCommandException {}
}
@Test(expected = OnapCommandInvalidSchema.class)
- public void invalidateTest5() throws OnapCommandException {
+ public void invalidateTest3() throws OnapCommandException {
OnapCommand cmd = new OnapCommand() {
@Override
protected void run() throws OnapCommandException {}
assertTrue(list.isEmpty());
}
- @Test(expected = OnapCommandInvalidSchema.class)
- public void invalidateTest3() throws OnapCommandException {
- OnapCommand cmd = new OnapCommand() {
- @Override
- protected void run() throws OnapCommandException {}
- };
- OnapCommandSchemaLoader.loadSchema(cmd, "schema-invalid-file.yaml", true, true);
- }
-
@Test
public void validateTest() throws OnapCommandException {