Skip to content

Commit

Permalink
SHIBUI-521(545): REST controller impl wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Jun 21, 2018
1 parent 56aa5b4 commit d864b36
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.stream.Stream;

@RestController
@RequestMapping("/api/MetadataResolver/{metadataResolverId}")
@RequestMapping("/api/MetadataResolvers/{metadataResolverId}")
public class MetadataFiltersController {

private static Logger LOGGER = LoggerFactory.getLogger(MetadataFiltersController.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package edu.internet2.tier.shibboleth.admin.ui.controller;

import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.MetadataResolver;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class MetadataResolversController {

@GetMapping("/MetadataResolvers")
ResponseEntity<?> getAll() {
//TODO implement
return ResponseEntity.ok().build();
}

@GetMapping("/MetadataResolvers/{resourceId}")
ResponseEntity<?> getOne(@PathVariable String resourceId) {
//TODO implement
return ResponseEntity.ok().build();
}

@PostMapping("/MetadataResolvers")
ResponseEntity<?> create(@RequestBody MetadataResolver newResolver) {
//TODO implement
return ResponseEntity.ok().build();
}

@PutMapping("/MetadataResolvers/{resourceId}")
ResponseEntity<?> update(@PathVariable String resourceId, @RequestBody MetadataResolver updatedResolver) {
//TODO implement
return ResponseEntity.ok().build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import spock.lang.Specification
import javax.persistence.EntityManager

/**
* A highly unnecessary test so that I can check to make sure that persistence is correct for the model
* Testing persistence of the MetadataResolver models
*/
@DataJpaTest
@ContextConfiguration(classes = [CoreShibUiConfiguration, SearchConfiguration, TestConfiguration])
Expand Down

0 comments on commit d864b36

Please sign in to comment.