Search in sources :

Example 6 with ProxyRequest

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));
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) ProxyTestSource.getProxyRequest(com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyRequest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with ProxyRequest

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());
}
Also used : ProxyResponse(com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse) ProxyTestSource.getProxyConfig(com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyConfig) ProxyConfig(com.sequenceiq.environment.proxy.domain.ProxyConfig) ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) ProxyTestSource.getProxyRequest(com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyRequest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 8 with ProxyRequest

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));
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

ProxyRequest (com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 Test (org.junit.jupiter.api.Test)4 MethodSource (org.junit.jupiter.params.provider.MethodSource)3 ProxyTestSource.getProxyRequest (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyRequest)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 ProxyResponse (com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse)1 ProxyConfig (com.sequenceiq.environment.proxy.domain.ProxyConfig)1 ProxyTestSource.getProxyConfig (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyConfig)1