use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method testProxyCreateSwaggerError.
@Test
public void testProxyCreateSwaggerError() throws Exception {
ProxyRequest request = getProxyRequest();
request.setPort(0);
assertThrows(BadRequestException.class, () -> client.proxyV1Endpoint().post(request));
}
use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method testProxyCreate.
@Test
public void testProxyCreate() throws Exception {
ProxyRequest request = getProxyRequest();
request.setPort(8080);
ProxyResponse result = client.proxyV1Endpoint().post(request);
assertEquals(request.getName(), result.getName());
Optional<ProxyConfig> saved = proxyConfigRepository.findByNameInAccount(request.getName(), TEST_ACCOUNT_ID);
assertTrue(saved.isPresent());
}
use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.
the class ProxyConfigAuthValidatorTest method testValidProxyConfigWithAuth.
@Test
public void testValidProxyConfigWithAuth() {
ProxyRequest proxyRequest = new ProxyRequest();
proxyRequest.setUserName("user");
proxyRequest.setPassword("pwd");
Assert.assertTrue(underTest.isValid(proxyRequest, null));
}
Aggregations