Skip to content

Commit 3a71636

Browse files
committed
release ArchUnit 0.22.0
Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
1 parent e890a80 commit 3a71636

File tree

21 files changed

+165
-3
lines changed

21 files changed

+165
-3
lines changed

example-junit4/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
testImplementation 'com.tngtech.archunit:archunit-junit4:0.21.0'
2+
testImplementation 'com.tngtech.archunit:archunit-junit4:0.22.0'
33
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.tngtech.archunit.example.layers.controller;
2+
3+
import com.tngtech.archunit.example.layers.controller.marshaller.StringUnmarshaller;
4+
5+
@SuppressWarnings("unused")
6+
public class OtherController {
7+
void receive(@UnmarshalTransport(StringUnmarshaller.class) Object param) {
8+
}
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.tngtech.archunit.example.layers.controller;
2+
3+
import java.lang.annotation.Retention;
4+
5+
import com.tngtech.archunit.example.layers.controller.marshaller.Unmarshaller;
6+
7+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
8+
9+
@Retention(RUNTIME)
10+
public @interface UnmarshalTransport {
11+
Class<? extends Unmarshaller<?>>[] value();
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.tngtech.archunit.example.layers.controller.marshaller;
2+
3+
public class ByteUnmarshaller implements Unmarshaller<Byte> {
4+
@Override
5+
public <T> T unmarschal(Byte from) {
6+
return null;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.tngtech.archunit.example.layers.controller.marshaller;
2+
3+
public class StringUnmarshaller implements Unmarshaller<String> {
4+
@Override
5+
public <T> T unmarschal(String from) {
6+
return null;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.tngtech.archunit.example.layers.controller.marshaller;
2+
3+
public interface Unmarshaller<F> {
4+
@SuppressWarnings("unused")
5+
<T> T unmarschal(F from);
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.tngtech.archunit.example.layers.service;
2+
3+
import com.tngtech.archunit.example.layers.controller.UnmarshalTransport;
4+
import com.tngtech.archunit.example.layers.controller.marshaller.ByteUnmarshaller;
5+
import com.tngtech.archunit.example.layers.controller.marshaller.StringUnmarshaller;
6+
7+
public class OtherServiceViolatingLayerRules {
8+
@SuppressWarnings("unused")
9+
public void dependentOnParameterAnnotation(@UnmarshalTransport({StringUnmarshaller.class, ByteUnmarshaller.class}) Object param) {
10+
}
11+
}

example-junit5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
testImplementation 'com.tngtech.archunit:archunit-junit5:0.21.0'
2+
testImplementation 'com.tngtech.archunit:archunit-junit5:0.22.0'
33
}
44

55
test {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.tngtech.archunit.example.layers.controller;
2+
3+
import com.tngtech.archunit.example.layers.controller.marshaller.StringUnmarshaller;
4+
5+
@SuppressWarnings("unused")
6+
public class OtherController {
7+
void receive(@UnmarshalTransport(StringUnmarshaller.class) Object param) {
8+
}
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.tngtech.archunit.example.layers.controller;
2+
3+
import java.lang.annotation.Retention;
4+
5+
import com.tngtech.archunit.example.layers.controller.marshaller.Unmarshaller;
6+
7+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
8+
9+
@Retention(RUNTIME)
10+
public @interface UnmarshalTransport {
11+
Class<? extends Unmarshaller<?>>[] value();
12+
}

0 commit comments

Comments
 (0)