Search in sources :

Example 16 with SecurityGroup

use of com.sequenceiq.cloudbreak.domain.SecurityGroup 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)

Aggregations

SecurityGroup (com.sequenceiq.cloudbreak.domain.SecurityGroup)16 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)4 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)2 InstanceGroup (com.sequenceiq.cloudbreak.domain.InstanceGroup)2 SecurityRule (com.sequenceiq.cloudbreak.domain.SecurityRule)2 Template (com.sequenceiq.cloudbreak.domain.Template)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 InstanceGroupParameterResponse (com.sequenceiq.cloudbreak.cloud.model.InstanceGroupParameterResponse)1 Json (com.sequenceiq.cloudbreak.domain.json.Json)1 Test (org.junit.Test)1 TypeDescriptor (org.springframework.core.convert.TypeDescriptor)1 AccessDeniedException (org.springframework.security.access.AccessDeniedException)1