@Test
public void testGetActiveTreatment() {

    post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_BAD)
        .entity(userDto)
        .assertStatus(Status.NO_CONTENT);
    final TreatmentDto expected1 = MAPPER.toDto(experiment(EXPERIMENT_1).getTreatment(user, user.computeAttributes()), TreatmentDto.class);
    final TreatmentDto expected2 = MAPPER.toDto(experiment(EXPERIMENT_2).getTreatment(device, device.computeAttributes()), TreatmentDto.class);
    final TreatmentDto actual1 =
        post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_1)
            .entity(userDto)
            .assertStatus(Status.OK)
            .result(TreatmentDto.class);
    assertEquals(expected1, actual1);
    // wrong type
    post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_1)
        .entity(deviceDto)
        .assertStatus(Status.NO_CONTENT);
    final TreatmentDto actual2 =
        post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_2)
            .entity(deviceDto)
            .assertStatus(Status.OK)
            .result(TreatmentDto.class);
    assertEquals(expected2, actual2);
    // not active
    post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_3)
        .entity(userDto)
        .assertStatus(Status.NO_CONTENT);
    // not allocated
    post(ENDPOINT_ACTIVE_TREATMENT, EXPERIMENT_4)
        .entity(userDto)
        .assertStatus(Status.NO_CONTENT);
}