Java / Remote Control Competition

Hello i’m reporting this issue, already asked about on discord:

Seems to be an error in the test script and/or description of the exercise

It might be helpful to supply details. Some people might not be on Discord :slightly_smiling_face:

is the exercise code itself expected to create prc1 and prc2 correctly and pass them to getRankedCars?

public static List<ProductionRemoteControlCar> getRankedCars(ProductionRemoteControlCar prc1, ProductionRemoteControlCar prc2) {

because it gives me this error:

[ERROR] COMPILATION ERROR : 
[ERROR] /tmp/solution/src/test/java/RemoteControlCarTest.java:[67,62] method getRankedCars in class TestTrack cannot be applied to given types;
  required: ProductionRemoteControlCar,ProductionRemoteControlCar
  found:    java.util.List<ProductionRemoteControlCar>
  reason: actual and formal argument lists differ in length
[ERROR] /tmp/solution/src/test/java/RemoteControlCarTest.java:[84,62] method getRankedCars in class TestTrack cannot be applied to given types;
  required: ProductionRemoteControlCar,ProductionRemoteControlCar
  found:    java.util.List<ProductionRemoteControlCar>
  reason: actual and formal argument lists differ in length
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project exercise: Compilation failure: Compilation failure: 
[ERROR] /tmp/solution/src/test/java/RemoteControlCarTest.java:[67,62] method getRankedCars in class TestTrack cannot be applied to given types;
[ERROR]   required: ProductionRemoteControlCar,ProductionRemoteControlCar
[ERROR]   found:    java.util.List<ProductionRemoteControlCar>
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /tmp/solution/src/test/java/RemoteControlCarTest.java:[84,62] method getRankedCars in class TestTrack cannot be applied to given types;
[ERROR]   required: ProductionRemoteControlCar,ProductionRemoteControlCar
[ERROR]   found:    java.util.List<ProductionRemoteControlCar>
[ERROR]   reason: actual and formal argument lists differ in length

More specifically, the stubs set up a getRankedCars() function which takes two Car objects. The unit tests pass in a list of Car objects. The stubs and unit tests should be in sync with what the function signature is.

+cc @andrerfcsantos @SleeplessByte Should I send a PR for this?

That would be appreciated. Thanks!

@andrerfcsantos Change TestTrack.getRankedCars stub to take a list of cars, consistent with the unit tests by IsaacG · Pull Request #2337 · exercism/java · GitHub

This should now be fixed.

1 Like