Skip to content
Snippets Groups Projects
Unverified Commit d3a1c792 authored by Martin Weise's avatar Martin Weise
Browse files

Added image 2

parent d3581866
Branches
Tags
1 merge request!106Dev
...@@ -149,6 +149,30 @@ public abstract class BaseUnitTest { ...@@ -149,6 +149,30 @@ public abstract class BaseUnitTest {
.defaultPort(IMAGE_1_PORT) .defaultPort(IMAGE_1_PORT)
.build(); .build();
public final static Long IMAGE_2_ID = 2L;
public final static String IMAGE_2_REPOSITORY = "mysql";
public final static String IMAGE_2_TAG = "8.0";
public final static String IMAGE_2_HASH = "83b40f2726e5";
public final static Integer IMAGE_2_PORT = 3306;
public final static String IMAGE_2_DIALECT = "org.hibernate.dialect.MySQLDialect";
public final static String IMAGE_2_DRIVER = "com.mysql.jdbc.Driver";
public final static String IMAGE_2_JDBC = "mysql";
public final static Long IMAGE_2_SIZE = 12000L;
public final static Instant IMAGE_2_BUILT = Instant.now().minus(38, HOURS);
public final static List<ImageEnvItemDto> IMAGE_2_ENV_DTO = List.of(ImageEnvItemDto.builder()
.iid(IMAGE_2_ID)
.key("MYSQL_USER")
.value("mysql")
.type(ImageEnvItemTypeDto.USERNAME)
.build(),
ImageEnvItemDto.builder()
.iid(IMAGE_2_ID)
.key("MYSQL_PASSWORD")
.value("mysql")
.type(ImageEnvItemTypeDto.PASSWORD)
.build());
public final static Long CONTAINER_1_ID = 1L; public final static Long CONTAINER_1_ID = 1L;
public final static String CONTAINER_1_HASH = "deadbeef"; public final static String CONTAINER_1_HASH = "deadbeef";
public final static String CONTAINER_1_NAME = "fda-userdb-u01"; public final static String CONTAINER_1_NAME = "fda-userdb-u01";
......
...@@ -68,13 +68,13 @@ public class ImageServiceIntegrationTest extends BaseUnitTest { ...@@ -68,13 +68,13 @@ public class ImageServiceIntegrationTest extends BaseUnitTest {
public void create_succeeds() public void create_succeeds()
throws ImageAlreadyExistsException, DockerClientException, ImageNotFoundException, UserNotFoundException { throws ImageAlreadyExistsException, DockerClientException, ImageNotFoundException, UserNotFoundException {
final ImageCreateDto request = ImageCreateDto.builder() final ImageCreateDto request = ImageCreateDto.builder()
.repository(IMAGE_1_REPOSITORY) .repository(IMAGE_2_REPOSITORY)
.tag(IMAGE_1_TAG) .tag(IMAGE_2_TAG)
.dialect(IMAGE_1_DIALECT) .jdbcMethod(IMAGE_2_JDBC)
.driverClass(IMAGE_1_DRIVER) .dialect(IMAGE_2_DIALECT)
.jdbcMethod(IMAGE_1_JDBC) .driverClass(IMAGE_2_DRIVER)
.defaultPort(IMAGE_1_PORT) .environment(IMAGE_2_ENV_DTO)
.environment(IMAGE_1_ENV_DTO) .defaultPort(IMAGE_2_PORT)
.build(); .build();
final Principal principal = new BasicUserPrincipal(USER_1_USERNAME); final Principal principal = new BasicUserPrincipal(USER_1_USERNAME);
......
...@@ -127,7 +127,7 @@ public class ImageServiceImpl implements ImageService { ...@@ -127,7 +127,7 @@ public class ImageServiceImpl implements ImageService {
@Override @Override
@Transactional @Transactional
public void delete(Long imageId) throws ImageNotFoundException, PersistenceException { public void delete(Long imageId) throws ImageNotFoundException {
try { try {
imageRepository.deleteById(imageId); imageRepository.deleteById(imageId);
} catch (EntityNotFoundException | EmptyResultDataAccessException e) { } catch (EntityNotFoundException | EmptyResultDataAccessException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment