Search in sources :

Example 1 with ProxyRequest

use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.

the class ProxyConfigAuthValidatorTest method testProxyConfigWithInvalidUserPwd.

@ParameterizedTest
@MethodSource("invalidUserPasswords")
public void testProxyConfigWithInvalidUserPwd(String user, String password) {
    ProxyRequest proxyRequest = new ProxyRequest();
    proxyRequest.setUserName(user);
    proxyRequest.setPassword(password);
    Assert.assertFalse(underTest.isValid(proxyRequest, null));
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with ProxyRequest

use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.

the class ProxyConfigAuthValidatorTest method testValidProxyConfigWithoutAuth.

@Test
public void testValidProxyConfigWithoutAuth() {
    ProxyRequest proxyRequest = new ProxyRequest();
    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)

Example 3 with ProxyRequest

use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.

the class ProxyTestSource method getProxyRequest.

public static ProxyRequest getProxyRequest() {
    ProxyRequest result = new ProxyRequest();
    result.setDescription(DESCRIPTION);
    result.setName(NAME);
    result.setUserName(USERNAME);
    result.setPassword(PASSWORD);
    result.setHost(SERVER_HOST);
    result.setPort(SERVER_PORT);
    result.setProtocol(PROTOCOL);
    result.setNoProxyHosts(NO_PROXY_HOSTS);
    return result;
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest)

Example 4 with ProxyRequest

use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.

the class ProxyRequestToProxyConfigConverterTest method testConvertEmptyPassword.

@ParameterizedTest
@MethodSource("invalidUserPasswords")
void testConvertEmptyPassword(String password) {
    ProxyRequest request = ProxyTestSource.getProxyRequest();
    request.setPassword(password);
    Assertions.assertNull(convert(request).getPassword());
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with ProxyRequest

use of com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest in project cloudbreak by hortonworks.

the class ProxyRequestToProxyConfigConverterTest method testConvertEmptyUser.

@ParameterizedTest
@MethodSource("invalidUserPasswords")
void testConvertEmptyUser(String user) {
    ProxyRequest request = ProxyTestSource.getProxyRequest();
    request.setUserName(user);
    Assertions.assertNull(convert(request).getUserName());
}
Also used : ProxyRequest(com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

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