void validateMaxResourcesRequired(Function.FunctionDetails functionDetails) {
        if (functionInstanceMaxResources != null) {
            Double maxCpu = functionInstanceMaxResources.getCpu();
            Long maxRam = functionInstanceMaxResources.getRam();

            if (maxCpu != null && functionDetails.getResources().getCpu() > maxCpu) {
                throw new IllegalArgumentException(
                        String.format(
                                "Per instance CPU requested, %s, for function is greater than the maximum required, %s",
                                functionDetails.getResources().getCpu(), maxCpu));
            }

            if (maxRam != null && functionDetails.getResources().getRam() > maxRam) {
                throw new IllegalArgumentException(
                        String.format(
                                "Per instance RAM requested, %s, for function is greater than the maximum required, %s",
                                functionDetails.getResources().getRam(), maxRam));
            }
        }
    }
@Test
    public void testValidateMaxResourcesRequired() throws Exception {
        factory = createKubernetesRuntimeFactory(null, null, null, null, false);

        FunctionDetails functionDetailsBase = createFunctionDetails();

        // max resources are not set
        try {
            factory.validateMaxResourcesRequired(functionDetailsBase);
        } catch (Exception e) {
            fail();
        }

        testMaxResource(0.2, 2048L, false, null);
        testMaxResource(1.00, 2048L, false, null);
        testMaxResource(1.01, 512L, true, "Per instance CPU requested, 1.01, for function is greater than the maximum required, 1.0");
        testMaxResource(1.00, 2049L, true, "Per instance RAM requested, 2049, for function is greater than the maximum required, 2048");

        testMaxResource(null, null, false, null);
        testMaxResource(0.2, null, false, null);
        testMaxResource(null, 2048L, false, null);
        testMaxResource(1.05, null, true, "Per instance CPU requested, 1.05, for function is greater than the maximum required, 1.0");
        testMaxResource(null, 3072L, true, "Per instance RAM requested, 3072, for function is greater than the maximum required, 2048");
    }