Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACS-930 Security update to spring boot 2.4.1 & Junit 5 #321

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,12 +26,9 @@
*/
package org.alfresco.transformer;

import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class AIOControllerHttpRequestTest extends AbstractHttpRequestTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,38 +26,35 @@
*/
package org.alfresco.transformer;

import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.Map;

import org.alfresco.transformer.executors.Transformer;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import java.io.IOException;
import java.util.Map;

import static org.junit.Assert.assertTrue;

@RunWith(SpringRunner.class)
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
/**
* Test the AIOController ImageMagick transforms without a server.
* Super class includes tests for the AbstractTransformerController.
*/
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
public class AIOControllerImageMagickTest extends ImageMagickControllerTest
{
// All tests contained in ImageMagickControllerTest

@Autowired
AIOTransformRegistry transformRegistry;

@Before @Override
@BeforeEach @Override
public void before() throws IOException
{
ReflectionTestUtils.setField(commandExecutor, "transformCommand", mockTransformCommand);
Expand Down Expand Up @@ -90,7 +87,7 @@ protected MockHttpServletRequestBuilder mockMvcRequest(String url, MockMultipart
public void testTestValidity()
{
// just test that we are actually testing against the AIOController (instead of MiscController)
assertTrue("Wrong controller wired for test", controller instanceof AIOController);
assertTrue(controller instanceof AIOController, "Wrong controller wired for test");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,22 +26,19 @@
*/
package org.alfresco.transformer;

import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Map;

import org.alfresco.transformer.executors.LibreOfficeJavaExecutor;
import org.alfresco.transformer.executors.Transformer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import java.util.Map;

import static org.junit.Assert.assertTrue;

@RunWith(SpringRunner.class)
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
/**
Expand All @@ -56,7 +53,7 @@ public class AIOControllerLibreOfficeTest extends LibreOfficeControllerTest
public void testTestValidity()
{
// just test that we are actually testing against the AIOController (instead of MiscController)
assertTrue("Wrong controller wired for test", controller instanceof AIOController);
assertTrue(controller instanceof AIOController,"Wrong controller wired for test");
}

@Autowired
Expand Down Expand Up @@ -87,29 +84,29 @@ protected MockHttpServletRequestBuilder mockMvcRequest(String url, MockMultipart
@Override
public void testGetTransformConfigInfo()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}

@Test
@Override
public void testGetInfoFromConfigWithDuplicates()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
@Test
@Override
public void testGetInfoFromConfigWithEmptyTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
@Test
@Override
public void testGetInfoFromConfigWithNoTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,15 +26,12 @@
*/
package org.alfresco.transformer;

import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;

import static junit.framework.TestCase.assertTrue;

@RunWith(SpringRunner.class)
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
public class AIOControllerMiscTest extends MiscControllerTest
Expand All @@ -46,36 +43,36 @@ public class AIOControllerMiscTest extends MiscControllerTest
public void testTestValidity()
{
// just test that we are actually testing against the AIOController (instead of MiscController)
assertTrue("Wrong controller wired for test", controller instanceof AIOController);
assertTrue(controller instanceof AIOController, "Wrong controller wired for test");
}

@Test
@Override
public void testGetTransformConfigInfo()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentality different.

}

@Test
@Override
public void testGetInfoFromConfigWithDuplicates()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
@Test
@Override
public void testGetInfoFromConfigWithEmptyTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
@Test
@Override
public void testGetInfoFromConfigWithNoTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,22 +26,20 @@
*/
package org.alfresco.transformer;


import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Map;

import org.alfresco.transformer.executors.Transformer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import java.util.Map;

import static org.junit.Assert.assertTrue;

@RunWith(SpringRunner.class)
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
/**
Expand Down Expand Up @@ -78,38 +76,38 @@ protected MockHttpServletRequestBuilder mockMvcRequest(String url, MockMultipart
public void testTestValidity()
{
// just test that we are actually testing against the AIOController (instead of MiscController)
assertTrue("Wrong controller wired for test", controller instanceof AIOController);
assertTrue(controller instanceof AIOController, "Wrong controller wired for test");
}

@Test
@Override
public void testGetTransformConfigInfo()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.


}
@Test
@Override
public void testGetInfoFromConfigWithDuplicates()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}

@Test
@Override
public void testGetInfoFromConfigWithEmptyTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}

@Test
@Override
public void testGetInfoFromConfigWithNoTransformOptions()
{
// Ignore the test in super class as the way the AIO transformer provides config is fundementally different.
// Ignore the test in super class as the way the AIO transformer provides config is fundamentally different.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
Expand All @@ -26,18 +26,14 @@
*/
package org.alfresco.transformer;


import java.io.IOException;

import org.alfresco.transform.client.model.TransformRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@WebMvcTest(AIOController.class)
@Import(AIOCustomConfig.class)
public class AIOControllerTest //extends AbstractTransformerControllerTest
Expand Down
Loading