Skip to content

Commit

Permalink
chore: Remove files that shouldn't have been there (duplicates)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Dec 31, 2024
1 parent f97d207 commit 929e2df
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 134 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.mulders.traqqr.api.measurements;

import it.mulders.traqqr.api.measurements.dto.MeasurementDto;
import it.mulders.traqqr.domain.measurements.Measurement;
import it.mulders.traqqr.domain.vehicles.Vehicle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.mulders.traqqr.api.measurements;

import it.mulders.traqqr.api.measurements.dto.MeasurementDto;
import it.mulders.traqqr.domain.measurements.MeasurementRepository;
import it.mulders.traqqr.domain.vehicles.Authorisation;
import it.mulders.traqqr.domain.vehicles.VehicleRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.mulders.traqqr.api.measurements;

import it.mulders.traqqr.api.measurements.dto.MeasurementDto;
import it.mulders.traqqr.domain.vehicles.Authorisation;
import it.mulders.traqqr.domain.vehicles.Vehicle;
import it.mulders.traqqr.mem.measurements.InMemoryMeasurementRepository;
Expand Down Expand Up @@ -34,16 +35,12 @@ public void testRegisterMeasurement_Success() {
var vehicle = new Vehicle("code123", "description", "ownerId", Set.of(Authorisation.fromInput("hashedKey123")));
vehicleRepository.save(vehicle);

var measurementDto = new MeasurementDto();
measurementDto.setTimestamp(OffsetDateTime.now());
measurementDto.setOdometer(1000);
var batteryDto = new MeasurementDto.BatteryDto();
batteryDto.setSoc((byte) 80);
measurementDto.setBattery(batteryDto);
var locationDto = new MeasurementDto.LocationDto();
locationDto.setLat(52.0);
locationDto.setLon(4.0);
measurementDto.setLocation(locationDto);
var measurementDto = new MeasurementDto(
OffsetDateTime.now(),
1000,
new MeasurementDto.BatteryDto((byte) 80),
new MeasurementDto.LocationDto(52.0, 4.0)
);

var headers = new ResteasyHttpHeaders(
new MultivaluedHashMap<>(Map.of("X-VEHICLE-API-KEY", "hashedKey123"))
Expand All @@ -56,16 +53,12 @@ public void testRegisterMeasurement_Success() {

@Test
public void testRegisterMeasurement_VehicleNotFound() {
var measurementDto = new MeasurementDto();
measurementDto.setTimestamp(OffsetDateTime.now());
measurementDto.setOdometer(1000);
var batteryDto = new MeasurementDto.BatteryDto();
batteryDto.setSoc((byte) 80);
measurementDto.setBattery(batteryDto);
var locationDto = new MeasurementDto.LocationDto();
locationDto.setLat(52.0);
locationDto.setLon(4.0);
measurementDto.setLocation(locationDto);
var measurementDto = new MeasurementDto(
OffsetDateTime.now(),
1000,
new MeasurementDto.BatteryDto((byte) 80),
new MeasurementDto.LocationDto(52.0, 4.0)
);

var headers = new ResteasyHttpHeaders(
new MultivaluedHashMap<>(Map.of("X-VEHICLE-API-KEY", "hashedKey123"))
Expand All @@ -80,16 +73,12 @@ public void testRegisterMeasurement_Unauthorized() {
var vehicle = new Vehicle("code123", "description", "ownerId", null);
vehicleRepository.save(vehicle);

var measurementDto = new MeasurementDto();
measurementDto.setTimestamp(OffsetDateTime.now());
measurementDto.setOdometer(1000);
var batteryDto = new MeasurementDto.BatteryDto();
batteryDto.setSoc((byte) 80);
measurementDto.setBattery(batteryDto);
var locationDto = new MeasurementDto.LocationDto();
locationDto.setLat(52.0);
locationDto.setLon(4.0);
measurementDto.setLocation(locationDto);
var measurementDto = new MeasurementDto(
OffsetDateTime.now(),
1000,
new MeasurementDto.BatteryDto((byte) 80),
new MeasurementDto.LocationDto(52.0, 4.0)
);

var headers = new ResteasyHttpHeaders(
new MultivaluedHashMap<>(Map.of("X-VEHICLE-API-KEY", "invalidKey"))
Expand Down

0 comments on commit 929e2df

Please sign in to comment.