Skip to content

Commit

Permalink
core(deps): Updated micronaut to latest version (#1247)
Browse files Browse the repository at this point in the history
and fixes to tests to have a successful build

close #1215
  • Loading branch information
meeraj257 authored Nov 6, 2022
1 parent 87d73b4 commit af5ca0d
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ configurations.all {
force("org.slf4j:slf4j-api:1.7.32")
force("org.slf4j:jul-to-slf4j:1.7.32")
force("org.slf4j:log4j-over-slf4j:1.7.32")
force("com.google.protobuf:protobuf-java:3.20.3")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
micronautVersion=3.2.2
micronautVersion=3.7.3
confluentVersion=7.0.1
kafkaVersion=3.0.0
kafkaScalaVersion=2.13
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/akhq/configs/SecurityProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SecurityProperties {
private List<BasicAuth> basicAuth = new ArrayList<>();
private String defaultGroup;

@MapFormat(transformation = MapFormat.MapTransformation.FLAT)
//@MapFormat(transformation = MapFormat.MapTransformation.FLAT)
private Map<String, Group> groups = new HashMap<>();

@PostConstruct
Expand All @@ -28,4 +28,8 @@ public void init() {
}
});
}
@Override
public String toString() {
return "defaultGroup ="+defaultGroup+" keys="+groups.keySet();
}
}
2 changes: 1 addition & 1 deletion src/test/java/org/akhq/KafkaTestCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void injectTestData() throws InterruptedException, ExecutionException {
log.debug("{} topic created", TOPIC_JSON_SCHEMA);

// consumer groups
for (int c = 0; c < 5; c++) {
for (int c = 0; c < CONSUMER_GROUP_COUNT; c++) {
Properties properties = new Properties();
properties.put("group.id", "consumer-" + c);

Expand Down
5 changes: 2 additions & 3 deletions src/test/java/org/akhq/configs/SecurityPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ void shouldReturnAllBasicGroups() {
CollectionUtils.toSet(new String[] {"admin", "limited", "operator", "no-filter"}),
securityProperties.getGroups().keySet()
);

ctx.close();
}

@Test
void shouldReturnAllBasicPlusConfiguredGroups() {
ApplicationContext ctx = ApplicationContext.run(ApplicationContext.class, "extragroups");
ApplicationContext ctx = ApplicationContext.run("extragroups");
SecurityProperties securityProperties = ctx.getBean(SecurityProperties.class);

assertEquals(
Expand All @@ -38,7 +37,7 @@ void shouldReturnAllBasicPlusConfiguredGroups() {

@Test
void shouldOverrideBasicGroups() {
ApplicationContext ctx = ApplicationContext.run(ApplicationContext.class, "overridegroups");
ApplicationContext ctx = ApplicationContext.run("overridegroups");
SecurityProperties securityProperties = ctx.getBean(SecurityProperties.class);

assertEquals(
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/org/akhq/controllers/GroupControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ void listApi() {
assertEquals(5, result.getResults().size());

result = this.retrievePagedList(HttpRequest.GET(BASE_URL + "?page=2"), ConsumerGroup.class);
assertEquals(1, result.getResults().size());
assertEquals("stream-test-example", result.getResults().get(0).getId());
assertEquals(2, result.getResults().size());
assertEquals("consumer-5", result.getResults().get(0).getId());
assertEquals("stream-test-example",result.getResults().get(1).getId());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SchemaControllerTest extends AbstractTest {
@Test
void listApi() {
ResultPagedList<Schema> result = this.retrievePagedList(HttpRequest.GET(BASE_URL), Schema.class);
assertEquals(5, result.getResults().size());
assertEquals(3, result.getResults().size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void partitionsApi() {
@Order(1)
void groupsApi() {
List<ConsumerGroup> result = this.retrieveList(HttpRequest.GET(TOPIC_URL + "/groups"), ConsumerGroup.class);
assertEquals(5, result.size());
assertEquals(KafkaTestCluster.CONSUMER_GROUP_COUNT, result.size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void loginExternalClaim() throws ParseException {
assertTrue(token.getJWTClaimsSet().getClaims().containsKey("topicsFilterRegexp"));
assertTrue(token.getJWTClaimsSet().getClaims().containsKey("roles"));

assertEquals("[\"filter1\",\"filter2\"]", token.getJWTClaimsSet().getClaims().get("topicsFilterRegexp").toString());
//assertEquals(List.of("filter1", "filter2"), token.getJWTClaimsSet().getClaims().get("topicsFilterRegexp").toString());
List<String> actualTopicFilters = token.getJWTClaimsSet().getStringListClaim("topicsFilterRegexp");
assertLinesMatch(List.of("filter1", "filter2"), actualTopicFilters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void before() {

@Test
void list() throws ExecutionException, InterruptedException {
mockApplicationContext();
assertEquals(KafkaTestCluster.CONSUMER_GROUP_COUNT, consumerGroupRepository.list(
KafkaTestCluster.CLUSTER_ID,
new Pagination(100, URIBuilder.empty(), 1),
Expand All @@ -50,7 +51,7 @@ void list() throws ExecutionException, InterruptedException {
@Test
void listWithConsumerGroupRegex() throws ExecutionException, InterruptedException {
mockApplicationContext();
assertEquals(5, consumerGroupRepository.list(
assertEquals(KafkaTestCluster.CONSUMER_GROUP_COUNT, consumerGroupRepository.list(
KafkaTestCluster.CLUSTER_ID,
new Pagination(100, URIBuilder.empty(), 1),
Optional.empty()
Expand Down

0 comments on commit af5ca0d

Please sign in to comment.