use of com.aliyuncs.fc.exceptions.ClientException in project fc-java-sdk by aliyun.
the class FunctionComputeClientTest method testCreateTriggerValidate.
@Test
public void testCreateTriggerValidate() {
try {
CreateTriggerRequest request = new CreateTriggerRequest(SERVICE_NAME, null);
client.createTrigger(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
CreateTriggerRequest request = new CreateTriggerRequest(SERVICE_NAME, "");
client.createTrigger(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
CreateTriggerRequest request = new CreateTriggerRequest(null, FUNCTION_NAME);
client.createTrigger(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
CreateTriggerRequest request = new CreateTriggerRequest("", FUNCTION_NAME);
client.createTrigger(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
}
use of com.aliyuncs.fc.exceptions.ClientException in project fc-java-sdk by aliyun.
the class FunctionComputeClientTest method testCreateServiceValidate.
@Test
public void testCreateServiceValidate() {
try {
CreateServiceRequest request = new CreateServiceRequest();
client.createService(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertEquals(ErrorCodes.INVALID_ARGUMENT, e.getErrorCode());
}
try {
CreateServiceRequest request = new CreateServiceRequest();
client.createService(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertEquals(ErrorCodes.INVALID_ARGUMENT, e.getErrorCode());
}
}
use of com.aliyuncs.fc.exceptions.ClientException in project fc-java-sdk by aliyun.
the class FunctionComputeClientTest method testCreateFunctionValidate.
@Test
public void testCreateFunctionValidate() {
try {
CreateFunctionRequest request = new CreateFunctionRequest(null);
client.createFunction(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
CreateFunctionRequest request = new CreateFunctionRequest("");
client.createFunction(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
}
use of com.aliyuncs.fc.exceptions.ClientException in project fc-java-sdk by aliyun.
the class FunctionComputeClientTest method testListFunctionsValidate.
@Test
public void testListFunctionsValidate() {
try {
ListFunctionsRequest request = new ListFunctionsRequest(null);
client.listFunctions(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
ListFunctionsRequest request = new ListFunctionsRequest("");
client.listFunctions(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
}
use of com.aliyuncs.fc.exceptions.ClientException in project fc-java-sdk by aliyun.
the class FunctionComputeClientTest method testUpdateServiceValidate.
@Test
public void testUpdateServiceValidate() {
try {
UpdateServiceRequest request = new UpdateServiceRequest(null);
client.updateService(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
try {
UpdateServiceRequest request = new UpdateServiceRequest("");
client.updateService(request);
fail("ClientException is expected");
} catch (ClientException e) {
assertTrue(e.getMessage().contains(VALIDATE_MSG));
}
}
Aggregations