forked from microsoftgraph/msgraph-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphErrorTests.java
More file actions
31 lines (23 loc) · 869 Bytes
/
Copy pathGraphErrorTests.java
File metadata and controls
31 lines (23 loc) · 869 Bytes
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
package com.microsoft.graph.http;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.microsoft.graph.core.GraphErrorCodes;
public class GraphErrorTests {
@Test
public void testIsError(){
String expectedMessage = "test error message";
GraphError error = new GraphError();
error.code = GraphErrorCodes.ACCESS_DENIED.toString();
error.message = expectedMessage;
assertTrue(error.isError(GraphErrorCodes.ACCESS_DENIED));
assertEquals(expectedMessage, error.message);
}
@Test
public void testIsNotError() {
GraphError error = new GraphError();
error.code = GraphErrorCodes.ACCESS_DENIED.toString();
assertFalse(error.isError(GraphErrorCodes.UNAUTHENTICATED));
}
}