### Question:
ImproveChargingStationLocationJsonCommandHandler extends JsonCommandHandler { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { ChargingStationId csId = new ChargingStationId(chargingStationId); if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), ImproveChargingStationLocationCommand.class)) { throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), ImproveChargingStationLocationCommand.class); } try { ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.isAccepted()) { ImproveChargingStationLocationApiCommand command = gson.fromJson(commandObject, ImproveChargingStationLocationApiCommand.class); commandGateway.send(new ImproveChargingStationLocationCommand(csId, command.getCoordinates(), command.getAddress(), command.getAccessibility(), identityContext)); } } catch (JsonSyntaxException ex) { throw new IllegalArgumentException("Improve charging station location command not able to parse the payload, is your JSON correctly formatted?", ex); } }  @Override String getCommandName(); @Override void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext);  }### Answer:
@Test public void testAddress() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{address:{addressLine1:'Teststraat 1',city:'Deurne',country:'NL'},accessibility:'PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }
@Test(expected = IllegalArgumentException.class) public void testAddressWrongAccessibility() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{address:{addressLine1:'Teststraat 1',city:'Deurne',country:'NL'},accessibility:'NON-PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }
@Test(expected = NullPointerException.class) public void testInvalidAddress() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{address:{addressLine:'Teststraat 1',city:'Deurne',country:'NL'},accessibility:'PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }
@Test public void testCoordinates() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{coordinates:{latitude:'0.0',longitude:'0.0'},accessibility:'PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }
@Test(expected = NumberFormatException.class) public void testInvalidCoordinatesNumber() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{coordinates:{latitude:'center',longitude:'0.0'},accessibility:'PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }
@Test(expected = NullPointerException.class) public void testInvalidCoordinates() throws UserIdentityUnauthorizedException { JsonObject commandObject = gson.fromJson("{coordinates:{lattitude:'0.0',longitude:'0.0'},accessibility:'PUBLIC'}", JsonObject.class); handler.handle(OperatorApiJsonTestUtils.CHARGING_STATION_ID_STRING, commandObject, IDENTITY_CONTEXT); }