generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathDemoTest.java
More file actions
28 lines (23 loc) · 919 Bytes
/
DemoTest.java
File metadata and controls
28 lines (23 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (c) 2024, 2026, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.org/license/UPL.
*/
package com.example;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@MicronautTest
class DemoTest {
@Inject
private PhotonService photonService;
@Test
void testEffectEquality() {
for (String effectName : new String[]{"grayscale", "flipv", "fliph", "obsidian"}) {
byte[] imageContent1 = photonService.processImage(effectName);
byte[] imageContent2 = photonService.processImage(effectName);
Assertions.assertArrayEquals(imageContent1, imageContent2, "Two processed images not identical when effect '%s' is used".formatted(effectName));
}
}
}