@Test(expected = IllegalArgumentException.class) public void testGetPolicies_controlPointDisabled() throws ControlPointApiException { Mockito.when(cpService.isEnabled()).thenReturn(false); controller.getPolicies(); }
@RequestMapping(method = RequestMethod.GET) public List<ControlPointPolicy> getPolicies() throws ControlPointApiException { checkEnabled(); return controlPointService.getPolicies().stream() .filter(policy -> policy.isActive() && policy.isPublished()) .collect(Collectors.toList()); }
ControlPointPolicyController { @RequestMapping(method = RequestMethod.GET) public List<ControlPointPolicy> getPolicies() throws ControlPointApiException { checkEnabled(); return controlPointService.getPolicies().stream() .filter(policy -> policy.isActive() && policy.isPublished()) .collect(Collectors.toList()); } }
ControlPointPolicyController { @RequestMapping(method = RequestMethod.GET) public List<ControlPointPolicy> getPolicies() throws ControlPointApiException { checkEnabled(); return controlPointService.getPolicies().stream() .filter(policy -> policy.isActive() && policy.isPublished()) .collect(Collectors.toList()); } @Autowired  ControlPointPolicyController(
        final ControlPointService controlPointService,
        final SavedSearchService<SavedSnapshot, SavedSnapshot.Builder> savedSnapshotService,
        final HavenSearchAciParameterHandler aciParameterHandler
    ); }
ControlPointPolicyController { @RequestMapping(method = RequestMethod.GET) public List<ControlPointPolicy> getPolicies() throws ControlPointApiException { checkEnabled(); return controlPointService.getPolicies().stream() .filter(policy -> policy.isActive() && policy.isPublished()) .collect(Collectors.toList()); } @Autowired  ControlPointPolicyController(
        final ControlPointService controlPointService,
        final SavedSearchService<SavedSnapshot, SavedSnapshot.Builder> savedSnapshotService,
        final HavenSearchAciParameterHandler aciParameterHandler
    ); @RequestMapping(method = RequestMethod.GET) List<ControlPointPolicy> getPolicies(); @RequestMapping(value = APPLY_PATH, method = RequestMethod.POST) void applyPolicy(
        @RequestParam(value = POLICY_PARAM) final String policy,
        @RequestParam(value = SAVED_SNAPSHOT_ID_PARAM, required = false) final Long snapshotId,
        @RequestBody(required = false) final SavedQuery query
    ); }
ControlPointPolicyController { @RequestMapping(method = RequestMethod.GET) public List<ControlPointPolicy> getPolicies() throws ControlPointApiException { checkEnabled(); return controlPointService.getPolicies().stream() .filter(policy -> policy.isActive() && policy.isPublished()) .collect(Collectors.toList()); } @Autowired  ControlPointPolicyController(
        final ControlPointService controlPointService,
        final SavedSearchService<SavedSnapshot, SavedSnapshot.Builder> savedSnapshotService,
        final HavenSearchAciParameterHandler aciParameterHandler
    ); @RequestMapping(method = RequestMethod.GET) List<ControlPointPolicy> getPolicies(); @RequestMapping(value = APPLY_PATH, method = RequestMethod.POST) void applyPolicy(
        @RequestParam(value = POLICY_PARAM) final String policy,
        @RequestParam(value = SAVED_SNAPSHOT_ID_PARAM, required = false) final Long snapshotId,
        @RequestBody(required = false) final SavedQuery query
    );  }