aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
blob: 06beb8d4092a3be0fb38da296eeb791c6eaca2dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.openecomp.sdc.asdctool.impl;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import java.nio.file.NoSuchFileException;

public class GraphJsonValidatorTest {

	private GraphJsonValidator createTestSubject() {
		return new GraphJsonValidator();
	}

	@Test
	public void testVerifyTitanJson() throws Exception {
		GraphJsonValidator testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.verifyTitanJson("src/test/resources/graph.json");
		assertTrue(result);
	}
	
	@Test
	public void testVerifyTitanJsonErrorFile() throws Exception {
		GraphJsonValidator testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.verifyTitanJson("src/test/resources/graphError.json");
		assertFalse(result);
	}
	
	@Test(expected=NoSuchFileException.class)
	public void testVerifyTitanJsonNoFile() throws Exception {
		GraphJsonValidator testSubject;

		// default test
		testSubject = createTestSubject();
		testSubject.verifyTitanJson("stam");
	}
}