Search in sources :

Example 6 with ModelingExercise

use of de.tum.in.www1.artemis.domain.ModelingExercise in project ArTEMiS by ls1intum.

the class ModelingExerciseResource method getModelingExercise.

/**
 * GET  /modeling-exercises/:id : get the "id" modelingExercise.
 *
 * @param id the id of the modelingExercise to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the modelingExercise, or with status 404 (Not Found)
 */
@GetMapping("/modeling-exercises/{id}")
@Timed
public ResponseEntity<ModelingExercise> getModelingExercise(@PathVariable Long id) {
    log.debug("REST request to get ModelingExercise : {}", id);
    ModelingExercise modelingExercise = modelingExerciseRepository.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(modelingExercise));
}
Also used : ModelingExercise(de.tum.in.www1.artemis.domain.ModelingExercise) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

ModelingExercise (de.tum.in.www1.artemis.domain.ModelingExercise)6 Timed (com.codahale.metrics.annotation.Timed)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Transactional (org.springframework.transaction.annotation.Transactional)3 URI (java.net.URI)1