Skip to content

Commit

Permalink
fix ObserverTransformerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutrymaco committed Feb 7, 2023
1 parent 33bddf0 commit 37bedf7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ public boolean appliesTo(Type observedType, Set<AnnotationInstance> qualifiers)

@Override
public void transform(TransformationContext context) {
if (context.getMethod().name().equals("")) {
context.transform().removeAll().done();
if (context.getMethod().name().equals("onMyEventRemoveQualifiers")) {
context.transform()
.remove(annotation -> annotation.name().equals(ALPHA_QUALIFIER))
.done();
}
}

Expand All @@ -73,6 +75,8 @@ public void transform(TransformationContext context) {
};
}

private static final DotName ALPHA_QUALIFIER = DotName.createSimple(AlphaQualifier.class);

@BravoQualifier
@Inject
Event<MyEvent> event;
Expand All @@ -89,7 +93,7 @@ public void testTransformation() {
@Singleton
static class MyObserver {

void onMyEventRemoveQualifiers(@Observes @BravoQualifier MyEvent event) {
void onMyEventRemoveQualifiers(@Observes @AlphaQualifier @BravoQualifier MyEvent event) {
event.log.add("onMyEventRemoveQualifiers");
}

Expand Down

0 comments on commit 37bedf7

Please sign in to comment.