-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuthTest.java
More file actions
27 lines (24 loc) · 852 Bytes
/
AuthTest.java
File metadata and controls
27 lines (24 loc) · 852 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
package com.checkmarx.ast;
import com.checkmarx.ast.wrapper.CxConfig;
import com.checkmarx.ast.wrapper.CxConstants;
import com.checkmarx.ast.wrapper.CxException;
import com.checkmarx.ast.wrapper.CxWrapper;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Map;
class AuthTest extends BaseTest {
@Test
void testAuthValidate() throws CxException, IOException, InterruptedException {
Assertions.assertNotNull(wrapper.authValidate());
}
//
@Test
void testAuthFailure() {
CxConfig cxConfig = getConfig();
cxConfig.setBaseAuthUri("wrongAuth");
cxConfig.setApiKey("InvalidApiKey");
Assertions.assertThrows(CxException.class, () -> new CxWrapper(cxConfig, getLogger()).authValidate());
}
}