Lasagna excercise

I got an error saying: java.lang.AssertionError: Method expectedMinutesInOven must be created

while the mehtod actually exists, why? Here the part of the Lasagna class with the method implementation:

public class Lasagna extends ReflectionProxy {



    @Override
    public String getTargetClassName() {
        return "Lasagna";
    }

    public int expectedMinutesInOven() {
        try {
            return 40;
            //return invokeMethod("expectedMinutesInOven", new Class[]{});
        } catch (Exception e) {
            throw new UnsupportedOperationException("Please implement the expectedMinutesInOven() method");
        }
    }

Please share full error messages, too! The answer should be buried in the error message. You did define a expectedMinutesInOven but I think the issue might be that it doesn’t have the expected signature.

I think you’re editing the wrong file too. Pretty sure the correct stub doesn’t have a ReflectionProxy that you have to edit.

You should put your code in src/main/java/Lasagna.java. By default it looks like this: https://github.com/exercism/java/blob/main/exercises/concept/lasagna/src/main/java/Lasagna.java

You seem to be editing this instead: https://github.com/exercism/java/blob/main/exercises/concept/lasagna/src/test/java/utils/ReflectionProxy.java

You 're completely right… new beginner with that application, I see the actual class to work on is located as you say in src/main/java.

thx both for very good help! Super cool tool to learn!

1 Like