asset-manager-web/src/test/java/io/bdrc/assetmanager/WorkTest/RunnableTestTest.java
@Test
    void uniqueWorkTestReplaceParameters() {
        RunnableTest wt = new RunnableTest("wtpName");
        Set<RunnableTestParameter> newWtps = new HashSet<>();
        newWtps.add(new RunnableTestParameter("wtp1name", "wtp1value"));
        newWtps.add(new RunnableTestParameter("wtp1name", "wtp2value"));

        Exception exception = assertThrows(InvalidObjectData.class, () -> wt.setRunnableTestParameters(newWtps));

        // Test the expected exception was thrown
        String expectedMessage = "RunnableTestParameter Collection has duplicate elements";
        String actualMessage = exception.getMessage();

        assertTrue(actualMessage.contains(expectedMessage));

    }
// Tests that you cannot add duplicate workTest Parameter names to a WorkTest
Tests that you cannot add duplicate workTest Parameter names to a WorkTest
Tests that you cannot add duplicate workTest Parameter names to a WorkTest
@Test
    void uniqueWorkTestReplaceParameters() {
        RunnableTest wt = new RunnableTest("wtpName");
        Set<RunnableTestParameter> newWtps = new HashSet<>();
        newWtps.add(new RunnableTestParameter("wtp1name", "wtp1value"));
        newWtps.add(new RunnableTestParameter("wtp1name", "wtp2value"));
        Exception exception = assertThrows(InvalidObjectData.class, () -> wt.setRunnableTestParameters(newWtps));
        String expectedMessage = "RunnableTestParameter Collection has duplicate elements";
        String actualMessage = exception.getMessage();
        assertTrue(actualMessage.contains(expectedMessage));
    }
@ Test void uniqueWorkTestReplaceParameters ( ) { RunnableTest wt = new RunnableTest ( "wtpName" ) ; Set < RunnableTestParameter > newWtps = new HashSet < > ( ) ; newWtps . add ( new RunnableTestParameter ( "wtp1name" , "wtp1value" ) ) ; newWtps . add ( new RunnableTestParameter ( "wtp1name" , "wtp2value" ) ) ; Exception exception = assertThrows ( InvalidObjectData . class , ( ) -> wt . setRunnableTestParameters ( newWtps ) ) ; String expectedMessage = "RunnableTestParameter Collection has duplicate elements" ; String actualMessage = exception . getMessage ( ) ; assertTrue ( actualMessage . contains ( expectedMessage ) ) ; }
Tests that you cannot add duplicate workTest Parameter names to a WorkTest
Tests that you cannot add duplicate workTest Parameter names to a WorkTest
// Test the expected exception was thrown