Search in sources :

Example 11 with SecurityRule

use of com.sequenceiq.cloudbreak.domain.SecurityRule in project cloudbreak by hortonworks.

the class SecurityGroupRequestToSecurityGroupConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    given(conversionService.convert(any(Object.class), any(TypeDescriptor.class), any(TypeDescriptor.class))).willReturn(Sets.newConcurrentHashSet(Collections.singletonList(new SecurityRule())));
    // WHEN
    SecurityGroup result = underTest.convert(getRequest("security-group/security-group.json"));
    // THEN
    assertAllFieldsNotNull(result, Arrays.asList("id", "owner", "account", "securityGroupId"));
}
Also used : TypeDescriptor(org.springframework.core.convert.TypeDescriptor) SecurityRule(com.sequenceiq.cloudbreak.domain.SecurityRule) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup) Test(org.junit.Test)

Example 12 with SecurityRule

use of com.sequenceiq.cloudbreak.domain.SecurityRule in project cloudbreak by hortonworks.

the class SecurityRuleRequestToSecurityRuleConverterTest method testConvert.

@Test
public void testConvert() {
    SecurityRule result = underTest.convert(createRequest("80,22,9443,1-65535"));
    assertAllFieldsNotNull(result, Collections.singletonList("securityGroup"));
}
Also used : SecurityRule(com.sequenceiq.cloudbreak.domain.SecurityRule) Test(org.junit.Test)

Aggregations

SecurityRule (com.sequenceiq.cloudbreak.domain.SecurityRule)12 Test (org.junit.Test)6 EndpointRule (com.sequenceiq.cloudbreak.api.model.EndpointRule)2 InstanceGroup (com.sequenceiq.cloudbreak.domain.InstanceGroup)2 SecurityGroup (com.sequenceiq.cloudbreak.domain.SecurityGroup)2 Port (com.sequenceiq.cloudbreak.api.model.Port)1 SecurityRuleRequest (com.sequenceiq.cloudbreak.api.model.SecurityRuleRequest)1 SecurityGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.SecurityGroupV2Request)1 Stack (com.sequenceiq.cloudbreak.domain.Stack)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 TypeDescriptor (org.springframework.core.convert.TypeDescriptor)1